 

function Show(id){
	//alert(id);
	document.getElementById(id).style.visibility="visible";
	document.getElementById(id).style.display="block";
	lastid = id;
}
function Hide(id){
	document.getElementById(id).style.visibility="hidden";
	document.getElementById(id).style.display="none";
	lastid = id;
}


function WYSIWYGtextareaCountChar(str, field)
{
	 var charCnt=str.length + " characters";
	 document.getElementById(field).value=charCnt;

}



function playAudio(embed){
	var soundobj=document.getElementById(embed);
	soundobj.Play();
}

function stopAudio(embed){
	var soundobj=document.getElementById(embed);
	soundobj.Stop();
}






var lastMenuid="voidLayer";
var dropCount=0;

function ShowMenu(id){
	//alert(id);
	document.getElementById(id).style.visibility="visible";
	document.getElementById(id).style.display="block";
	lastMenuid = id;
	dropCount++;
}
function HideMenu(id){
	document.getElementById(id).style.visibility="hidden";
	document.getElementById(id).style.display="none";
	lastMenuid = id;
	dropCount = dropCount -1 ;
}


function checkMenuCount(){
	if(dropCount>0){
		HideMenu(lastMenuid);
	}
}



function ClearDIV(id){
	document.getElementById(id).innerHTML='';
}

function ClearValue(id){
	document.getElementById(id).value='';
}

//function getValue(id){
//	return document.getElementById(id).value;
//}

function getInnerHTML(id){
	return document.getElementById(id).innerHTML;
}

function getInnerHTMLtoVar(id){
	var gHTML = document.getElementById(id).innerHTML;
}



function showWorking(id){
	
	document.getElementById(id).innerHTML="<center><br/><br/><span style='color:#C0C0C0'>Processing...</span><br/><br/><img src='http://www.stonecroft.org/elithica2/images/gear1.gif'></center>";
}


function showWorkingWhiteDiv(id){
	
	document.getElementById(id).innerHTML="<div style='width:100%; height:100%;text-align:center;background-color: #FFFFFF'><br/><br/><span style='color:#C0C0C0'>Processing...</span><br/><br/><img src='http://www.stonecroft.org/elithica2/images/gear1.gif'></div>";
}

function showWorkingSmall(id){
	
	document.getElementById(id).innerHTML="<center><img src='http://www.stonecroft.org/elithica/images/working_small.gif'></center>";
}

function showMediaWorking(id){
	
	document.getElementById(id).innerHTML="<center><img src='http://www.stonecroft.org/elithica/images/design_images/media/prog-bar.gif'></center>";
}

function resetConfirmation(id){
		setTimeout("document.getElementById('"+id+"').innerHTML='';", 2000);
}

function resetConfirmationTimed(id, time_length){
		setTimeout("document.getElementById('"+id+"').innerHTML='';", time_length);
}

function resetConfirmationMsg(id, msg){
		setTimeout("document.getElementById('"+id+"').innerHTML='"+msg+"';", 2000);
}

function resetHideDiv(id){
		setTimeout("document.getElementById('"+id+"').style.visibility='hidden';", 2000);
		setTimeout("document.getElementById('"+id+"').style.display='none';", 2000);
}




function disableElement(id){
	
	document.getElementById(id).disabled=true;
	
}

function enableElement(id){
	
	document.getElementById(id).disabled=false;
	
}


/*Div Scrolling*/
var zxcTO;

function ScrollVerticle(id,dis,pos){
 var obj=document.getElementById(id)
 obj.scrollTop=obj.scrollTop+dis;
 if (pos){obj.scrollTop=pos; }
 else {zxcTO=setTimeout( function(){ ScrollVerticle(id,dis); },10); }
}

function ScrollHorizontal(id,dis,pos){
 var obj=document.getElementById(id)
 obj.scrollLeft=obj.scrollLeft+dis;
 if (pos){obj.scrollLeft=pos; }
 else {zxcTO=setTimeout( function(){ ScrollHorizontal(id,dis); },10); }
}



/*Custom*/
function resetConfirmReloadSiteLinks(id){
		setTimeout("document.getElementById('"+id+"').innerHTML='';", 2000);
		setTimeout("NuntiusAjax.Request('storelinks.linkForm', ' ', 'returnDiv', 0, 0);", 2000);
}

function statusChangePending(id){
	//$line.="	alert(id+'row');";
	document.getElementById(id+'row').style.backgroundColor='#990000';	
}



function checkState(state){
	
	if(state=="other"){
		//alert(state);
		document.getElementById('provinceDIV').innerHTML="<input type='text' id='state' name='state' value='state'>";
	}
		
}
