/***********/
var prefix_url="http://ksa.obeikaneducation.com/ar/";
function openGlossary(){
	PopupCenter('http://ksa.obeikaneducation.com/eglossary/','Glossary',680,580);
	//alert("openGlossary");		
}
/***********/
function openLearningObject(id){
	
	var pos=id.lastIndexOf('.');
	var prefix_url="";
	var path="";
	//var winWidth=665;
	//var winHeight=450;
	var winWidth=800;
	var winHeight=600;
	if (pos!=-1){
		var file_ext=id.substring(pos+1);
		file_ext=file_ext.toUpperCase();
		if (file_ext=="SWF"){
			path=prefix_url+"swf/loader.html?"+id;
		}else if (file_ext=="PDF"){
			path=prefix_url+"pdf/"+id;
		}else if (file_ext=="PPT" || file_ext=="PPTX"){
			path=prefix_url+"ppt/"+id;
		}else{
			alert(id);
		}
		var left = (screen.width/2)-(winWidth/2);
		var top = (screen.height/2)-(winHeight/2);		
		window.open(path,null,'width='+winWidth+',height='+winHeight+',left='+left+',top='+top+',resizable=1, copyhistory=no,toolbar=no, location=no, directories=no, status=no, menubar=no');
	}else{
		alert("File Not Found!");	
	}
}
/***********/
function PopupCenter(pageURL, title,w,h) {
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
} 
/***********/
function doAction(target){	
	var url="";
	if (target=="Home"){
		var url="home";
	}else if (target=="FAQ"){
		var url="node/3";
	}else if (target=="News"){
		var url="node/4";
	}else if (target=="SiteMap"){
		var url="sitemap";	
	}else if (target=="Links"){
		var url="node/6";
	}else if (target=="ContactUs"){
		var url="node/7";		
	}
	window.location=prefix_url+url;
}
/***********/
function submitform(){
	with (document.forms['search_form_drupal']){
		action=prefix_url;
		submit();
	}
	return false;
}
