// Misc. Functions 




function openAlertLayer(msg,icon){
	document.getElementById('error').style.visibility = 'visible';
	document.getElementById('error').innerHTML = '<div id="error_msg"></div><div id="error_ballon"><span class="error_icon"><img src="../Theme/'+icon+'.png" /></span><span class="alert_texts_small">'+msg+'</span></div>';
}

function openUploadLayer(msg){
	document.getElementById('error').style.visibility = 'visible';
	document.getElementById('error').innerHTML = '<div id="error_msg"></div><div id="error_ballon"><span class="upload_icon"><img src="../Theme/uploadbar.gif" /></span><span class="uploadtxt">'+msg+'</span></div>';
}

function closeAlertLayer(){
	document.getElementById('error').style.visibility = 'hidden';
}

function SetupWindowClose()
{
	window.setTimeout("closeAlertLayer()",3*1000);
}

function showLogs(id){
document.getElementById('expand').style.position = 'relative';
document.getElementById('expand').style.visibility = 'visible';
}

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function toogleAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}


/* Menu  */
	   c=0
		du="";
	   function a(dv,n){		
		    
		   for(i=1;i<=n;i++){			
			   if(i==dv ){
				   if(du!=dv){
				      document.getElementById('mdiv'+i).style.display="inline"
					   du=dv
					}else{
					   du=""
					   document.getElementById('mdiv'+i).style.display="none"
					}
			   }else{
				     document.getElementById('mdiv'+i).style.display="none"				  					
			   }				
				
			}		
		}
		
	function reveza(qq){
	  document.getElementById(qq).className="itens_menu_r"
	}
	function volta(qq){
	  document.getElementById(qq).className="itens_menu"
	}


function showInfo(text,id){
document.getElementById('infoballon'+id).style.visibility="visible"				  					
document.getElementById('ballontext'+id).style.visibility="visible"				  					
document.getElementById('ballontext'+id).innerHTML = text; 
}

function hideInfo(id){
	window.setTimeout("closeInfo("+id+")",2*1000);
}

function closeInfo(id){
document.getElementById('infoballon'+id).style.visibility="hidden"				  					
document.getElementById('ballontext'+id).style.visibility="hidden"				  					
}

function tabControl(elmnt,content){
    if (content.length==elmnt.maxLength){
      next=elmnt.tabIndex
      if (next<document.forms[0].elements.length){
        document.forms[0].elements[next].focus()
    }
  }
}


function alertMessage(message){
	alert(message);

}


function goUp(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit+ area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function goDown(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit + area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function goL1Up(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering_l1.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit+ area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function goL1Down(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering_l1.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit + area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}



function goL2Up(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering_l2.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit+ area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function goL2Down(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering_l2.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit + area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}



function goL3Up(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering_l3.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit+ area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function goL3Down(Area,Id,Order,Limit){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  Area+'/ordering_l3.php?Id='; //This is the path to the file we just finished making *
       var order = '&Order='; //This is the path to the file we just finished making *
       var limit = '&Limit='; //This is the path to the file we just finished making *
       var area = '&Area='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + Id + order + Order + limit + Limit + area + Area, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('ordering'+Id).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}



function openCalendar(x,y,z,b){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  'Events/calendar.php?x='; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file + x + '&y=' + y + '&z=' + z + '&b=' + b, true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById(b).style.visibility = 'visible'; //Change the inner content of your div to the newly retrieved content ****
                      document.getElementById(b).innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}

function setStartDate(x,y,z,b){
var day = b + 'day';	
var year = b + 'year';	
var month = b + 'month';	
document.getElementById(year).value = x; 
document.getElementById(month).value = y; 
document.getElementById(day).value = z; 
document.getElementById(b).style.visibility = 'hidden';
	
}


function createLink(){
var xmlhttp=false; //Clear our fetching variable
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object…
        } catch (e) {
                try {
                        xmlhttp = new
                        ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
            } catch (E) {
                xmlhttp = false;
                        }
        }
        if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                xmlhttp = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
        }
       var file =  'Navigation/menu.php'; //This is the path to the file we just finished making *
    xmlhttp.open('GET', file , true); //Open the file through GET, and add the page we want to retrieve as a GET variable **
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4) { //Check if it is ready to recieve data
                var content = xmlhttp.responseText; //The content data which has been retrieved ***
                if( content ){ //Make sure there is something in the content variable
                      document.getElementById('submenu').innerHTML = content; //Change the inner content of your div to the newly retrieved content ****
                } 
        }
        }
        xmlhttp.send(null) //Nullify the XMLHttpRequest
return;
}


function destroyLink(text){
document.getElementById('submenu').innerHTML = '<table width="50%" border="0" align="left" cellpadding="0" cellspacing="0"><tr><td width="5%"><div align="left"><span class="formtexts"><input name="menu" type="checkbox" id="menu" value="1" onclick="createLink()" checked="checked" /></span></div></td><td><div align="left"><span class="formtexts">'+text+'</span></div></td></tr></table>'; 
}

function addField(check,text){
if (check<1){
document.getElementById('other').innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><div align="left"><span class="formtexts">'+text+'</span></div></td></tr><tr><td><input name="windowname" type="text" id="windowname" class="formfields" size="15"></td></tr></table>'; 
}
if(check!=0){
document.getElementById('other').innerHTML = ''; 
}
}


