
function change(id) {
	var newClass = 'visiblediv';
	var oldClass = 'hiddendiv';
	allPageTags=document.getElementsByTagName("div");
	for (i=0; i<allPageTags.length; i++) {
		if (allPageTags[i].className==newClass) {
			allPageTags[i].className=oldClass;
		}
	}
	identity=document.getElementById(id);
	if(!printView)
		identity.className=newClass;
}

function setcookievalue(name,value){
	//alert("updating the cookie: Adding the value="+value);
	document.cookie=name+"="+value+";Path=/";
	//alert("The cookies are:"+getcookievalue("BasketItem"));
}

function getcookievalue(name){
	var temp=document.cookie+";";
	var Pos=temp.indexOf("=",temp.indexOf(name+"="));
	if (temp.indexOf(name+"=")==-1) return "";
	return temp.substring(Pos+1,temp.indexOf(";",Pos));
}
function setSize(size)	{
	switch(size)	{
		case 'small':setcookievalue('CSTextSize','CSTextSizeSmall');
		break;
		case 'large':setcookievalue('CSTextSize','CSTextSizeLarge');
		break;
		default: case 'small':setcookievalue('CSTextSize','');
		break;
	}
	document.location.reload();
}

function CSWebsiteHeaderSearchResults(){
	var fqt="(dDocType <matches> `DOCUMENTS` <or> dDocType <matches> `WEBPAGES` <or> dDocType <matches> `CSNews`)";
	var qt=document.CSWEBSITEFORM.sitesearch2.value;
	//qt = qt.toLowerCase();
	
	if (qt !=null && qt != 'Search' && qt.length !=0)	{
		fqt+= " <and> ([50]dDocTitle <substring> `"+qt+"` <or> [30]xKeywords <substring> `"+qt+"` <or>  [10]xDescription <substring> `"+qt+"` <or> [10]xComments <substring> `"+qt+"`)";
	}
	document.CSWEBSITEFORM.QueryText.value=fqt;
	document.CSWEBSITEFORM.submit();
}



function CSWebsiteHeaderSearchResultsOld(){
	var fqt = gqt + " ";
	var qt=document.CSWEBSITEFORM_OLD.sitesearch2.value;
	qt = qt.toLowerCase();
	if (qt !=null && qt != 'Search' && qt.length !=0)	{
			fqt+= " <and> (xDescription <substring> `"+qt+"` <or> xKeywords <substring> `"+qt+"` <or> dDocTitle <substring> `"+qt+"` <or> (`"+qt+"`))      <or> (`"+qt+"`)";
	}
	document.CSWEBSITEFORM_OLD.QueryText.value=fqt;
	document.CSWEBSITEFORM_OLD.submit();
}
	
	
	function giveStartDate(Month,Year)
	{
	if(Month==1)
		result="31/12/"+(parseInt(Year)-1)+" 23:59";
	if(Month==2)
		result="31/1/"+Year+" 23:59";
	if(Month==3)
		result="28/2/"+Year+" 23:59";
	if(Month==4)
		result="31/3/"+Year+" 23:59";
	if(Month==5)
		result="30/4/"+Year+" 23:59";
	if(Month==6)
		result="31/5/"+Year+" 23:59";
	if(Month==7)
		result="30/6/"+Year+" 23:59";
	if(Month==8)
		result="31/7/"+Year+" 23:59";
	if(Month==9)
		result="31/8/"+Year+" 23:59";
	if(Month==10)
		result="30/9/"+Year+" 23:59";
	if(Month==11)
		result="31/10/"+Year+" 23:59";
	if(Month==12)
		result="30/11/"+Year+" 23:59";
	return result;
 }
 function giveEndDate(Month,Year)
 {
	if(Month==1)
		result="31/1/"+Year+" 0:00";
	if(Month==2)
		result="28/2/"+Year+" 0:00";
	if(Month==3)
		result="31/3/"+Year+" 0:00";
	if(Month==4)
		result="30/4/"+Year+" 0:00";
	if(Month==5)
		result="31/5/"+Year+" 0:00";
	if(Month==6)
		result="30/6/"+Year+" 0:00";
	if(Month==7)
		result="31/7/"+Year+" 0:00";
	if(Month==8)
		result="31/8/"+Year+" 0:00";
	if(Month==9)
		result="30/9/"+Year+" 0:00";
	if(Month==10)
		result="31/10/"+Year+" 0:00";
	if(Month==11)
		result="30/11/"+Year+" 0:00";
	if(Month==12)
		result="1/1/"+(parseInt(Year)+1)+" 0:00";
	return result;
 }

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
} 

