// JavaScript Document
	function getDivByID(layerID) {
		if (document.getElementById) {
			// this is the way the standards work
			return document.getElementById(layerID);
		} else if (document.all) {
			// this is the way old msie versions work
			return document.all[layerID];
		} else if (document.layers){
			// this is the way nn4 works
			return document.layers[layerID];
		}
		return null;
	}
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}
	function ltrim(stringToTrim) {
		return stringToTrim.replace(/^\s+/,"");
	}
	function rtrim(stringToTrim) {
		return stringToTrim.replace(/\s+$/,"");
	}
	function isAlphaNumeric(val){
		if (val.match(/^[a-zA-Z0-9]+$/)){
			return true;
		}else{
			return false;
		} 
	}
	function fncCheckEmailFormat(strEmail){
		emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
		if(!emailpat.test(strEmail)) return false; else return true;
	}
	function __fncGetXMLHttpRequest(){
		var http_request = false;
		if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/html');
			}
		} else if (window.ActiveXObject) { // IE
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {}
			}
		}
		if (!http_request) {
			return false;
		}
		return http_request;
	}
	function __fncLoadFullBookSetDetails(bookSet){
		if(getDivByID('divSetDetails'+bookSet).style.display=='block'){
			getDivByID('divSetDetails'+bookSet).style.display='none';
			return;
		}else{getDivByID('divSetDetails'+bookSet).style.display='block'}
		xmlHttp = __fncGetXMLHttpRequest();
		xmlHttp.onreadystatechange=function() {
			if(xmlHttp.readyState==4){
				if (xmlHttp.status == 200) {
					getDivByID('divSetDetails'+bookSet).innerHTML=xmlHttp.responseText;
				}
			}
		}
		xmlHttp.open("GET","./Ajax/__Text.Book.Set.Details.php?set="+bookSet,true);
		xmlHttp.send(null);
	}
	function isAlpha(val){
		if (val.match(/^[a-z A-Z]+$/)){
			return true;
		}else{
			return false;
		} 
	}
	function isAccademic(val){
		if (val.match(/^[1-9]{1}\d{3}\-[1-9]{1}\d{3}$/)){
			return true;
		}else{
				return false;
		} 
	}
	
	//print 
	function popup() {
	  //var contentHTML = document.getElementById('PrintContent').innerHTML;
	  //var winPopup = writeConsole();
	  
	 var con = '<div id=\"placeHolder\" align=\"center\">'+ contentHTML +'</div>';
	 top.consoleRef=window.open('','placeHolder',
	  'width=800,height=800'
	   +',left=500'
	   +',top=300'
	   +',menubar=0'
	   +',toolbar=0'
	   +',status=0'
	   +',scrollbars=0'
	   +',resizable=1')
	 top.consoleRef.document.writeln(
	  '<html><head><style type="text/css"> td{ font-family:Arial, Helvetica, sans-serif; font-size:11px;} th{ font-family:Arial, Helvetica, sans-serif; font-size:11px;}</style><title>Content Pop-Up</title><script type=\"text/javascript\" language=\"JavaScript\">var timerDelay; function showIt(){document.getElementById(\'placeHolder\').innerHTML = window.opener.contentHTML; timerDelay = window.setTimeout(\"window.print()\",1000);}<\/script></head>'
	   +'<body onLoad="showIt()">'
	   +con
	   +'</body></html>'
	 )
	 top.consoleRef.document.close()
	}
		
	function release() {
	  var contentReleaseHTML = document.getElementById('PrintReleas').innerHTML;
	  //var winPopup = writeConsole();
	  
	 var con = '<div id=\"placeRelease\" align=\"center\">'+ contentReleaseHTML +'</div>';
	 top.consoleRef=window.open('','placeRelease',
	  'width=800,height=800'
	   +',left=500'
	   +',top=300'
	   +',menubar=0'
	   +',toolbar=0'
	   +',status=0'
	   +',scrollbars=0'
	   +',resizable=1')
	 top.consoleRef.document.writeln(
	  '<html><head><style type="text/css"> td{ font-family:Arial, Helvetica, sans-serif; font-size:11px;} th{ font-family:Arial, Helvetica, sans-serif; font-size:11px;}</style><title>Content Pop-Up</title><script type=\"text/javascript\" language=\"JavaScript\">var timerDelay; function showIt(){timerDelay = window.setTimeout(\"window.print()\",1000);}<\/script></head>'
	   +'<body onLoad="showIt()">'
	   +con
	   +'</body></html>'
	 )
	 top.consoleRef.document.close()
	}
		
