//Function to change cotent with tab buttons
var curtab;
function toggleTab(id){
	//alert(id+'_content')
	
	var tabs = 3;
	
	for( var f = 0; f <= tabs; f++ )
	{
		if (id != 'tab'+f) {
			document.getElementById('tab'+f+'_content').style.display='none';
			document.getElementById('tab'+f).className='tab0';
			setOpacity(document.getElementById('tab'+f+'_content'),0)
		}  else {
			curtab = f;
			fadeIn(id+'_content',10)
			document.getElementById(id).className='tab';
			document.getElementById(id+'_content').style.display='';
		}
	}
}




function toggleEmailTab(id){
	//alert(id+'_content')
	var tabs = 1;
	
	for( var f = 0; f <= tabs; f++ )
	{
		if (id != 'emailTab'+f) {
			document.getElementById('emailTab'+f+'_content').style.display='none';
			document.getElementById('emailTab'+f).className='emailtab0';
			setOpacity(document.getElementById('emailTab'+f+'_content'),0)
		}
	}
	
	fadeIn(id+'_content',10)
	document.getElementById(id).className='emailtab';
	document.getElementById(id+'_content').style.display='';
}



function setOpacity(obj, opacity) {	
  opacity = (opacity == 100)?99.999:opacity;
   // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
   // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
   // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
   // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}




//////////////////
// URL REQUEST ///
//////////////////

var xmlhttp=false;
/*#@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}


function gotoURL(type,id,var1,var2) {
	//alert(type)
	//alert(var1)
	if (type === 'SaveNav') {
		//alert ('delete rct '+id);
		xmlhttp.open("GET", "scripts/action.php?type=SaveNav&list="+id,true);
	}  else {
		//xmlhttp.open("GET", "action.php?type="+type+"&id="+id+"&var1="+var1+"&var2="+var2,true);
	}
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				
				//if (type === 'ScanCountApp' || type === 'ScanCount') {
				//returnScanCount(xmlhttp.responseText);
				//}
			//alert(xmlhttp.responseText)
			   //alert('OK');
			   return xmlhttp.responseText;
			}
		}
		xmlhttp.send(null)
	
}






//Function to 'insert' and 'remove' content by id
//eg: javascript:RemoveContent('tab1');
function RemoveContent(d) {
document.getElementById(d).style.display = "none";
}

//eg: javascript:InsertContent('tab1');
function InsertContent(d) {
document.getElementById(d).style.display = "";
}
//------------------------------------------------
