// display decision alert box
function decision(message, url){
	if(confirm(message)) location.href = url;
}

// open browser window
function openPopUp(url, windowName, w, h, scrollbar) {

           var winl = (screen.width - w) / 2;
           var wint = (screen.height - h) / 2;
           winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrollbar ;
		   win = window.open(url, windowName, winprops);
           if (parseInt(navigator.appVersion) >= 4) { 
              	win.window.focus(); 
           } 
}
//-- jumb menu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-- hide layer
function hide(div) {
	
	if (document.getElementById)
		document.poppedLayer = eval('document.getElementById(div)');
	else if (document.all)
		document.poppedLayer = eval('document.all[div]');
	else
		document.poppedLayer = eval('document.layers[div]');
		document.poppedLayer.style.display = "none";
}
//-- show div
function show(div) {
  if (document.getElementById)
     document.poppedLayer = eval('document.getElementById(div)');
  else if (document.all)
     document.poppedLayer = eval('document.all[div]');
  else
     document.poppedLayer = eval('document.layers[div]');
  document.poppedLayer.style.display = "block";
}

function ShowHide(obj) {
	if(document.getElementById){
		divs = document.getElementsByTagName("div");
			if(divs[obj].style.display == 'none'){
				divs[obj].style.display = 'block';
			}else{
				divs[obj].style.display = 'none';
			}
	}
}


//-- writing text to DIV
function WriteLayer(ID,parentID, sText) {
	
	
	
	if(document.getElementById){
		divs = document.getElementsByTagName("div");
			if(divs[ID].style.display == 'none'){
				divs[ID].style.display = 'block';
				
				//show(ID);
	
	if (document.layers) {
   var oLayer;
   if(parentID){
     oLayer = eval('document.' + parentID + '.document.' + ID + '.document');
   }else{
     oLayer = document.layers[ID].document;
   }
   oLayer.open();
   oLayer.write('<a href="javascript:hide(\''+ID+'\');"><img src="http://www.alazhr.com/quran/image/'+sText+'.gif" alt="" class="ayaImg" /></a>');
   oLayer.close();
 }
 else if (parseInt(navigator.appVersion)>=5&&navigator.
appName=="Netscape") {
   document.getElementById(ID).innerHTML = '<a href="javascript:hide(\''+ID+'\');"><img src="http://www.alazhr.com/quran/image/'+sText+'.gif" alt="" class="ayaImg" /></a>';
 }
 else if (document.all) document.all[ID].innerHTML = '<a href="javascript:hide(\''+ID+'\');"><img src="http://www.alazhr.com/quran/image/'+sText+'.gif" alt="" class="ayaImg" /></a>';
				
				
				
			}else{
				divs[ID].style.display = 'none';
			}
	}
}

//--- to set reader
function play(){
	
	var list = document.forms[0].readers;
	var listValue = list.options[list.selectedIndex].value;
	document.embeds[0].DoStop();
	document.embeds[0].SetSource(listValue);
	document.embeds[0].DoPlay();
	return false;
}


