﻿
/*
General script
versie 1.2 (9 jul 2009)
versie 1.1 (28 feb 2007)
Versie 1 (16 sep 2003)
*/


/* Send to a friend functionaliteit */
function SendMail(lstrTitle, lstrURL)
{
    window.open("/scripts/sendmail.aspx?subject="+ lstrTitle + "&url="+ lstrURL ,"","width=370,height=410,left=50,top=50,resizable=yes,scrollbars=yes");
}

/* Send to a friend functionaliteit */
function RatePhoto(lstrID, lstrTitle)
{
    window.open("/members/ratephoto.aspx?id="+ lstrID + "&title="+ lstrTitle ,"","width=370,height=410,left=50,top=50,resizable=yes,scrollbars=yes");
}



/* Pagina printen zonder opmaak */
function Print(lstrOrgineleContent) 
{
	var endScript = "ipt";
	var tmpUrl = ' ' + document.location;
	var lstrContents = "	<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">";
	lstrContents = lstrContents + "<html>";
	lstrContents = lstrContents + "<head>";
	lstrContents = lstrContents + "<title>" + document.title + "</title>";
	lstrContents = lstrContents + "<meta http-equiv=\"Pragma\" content=\"no-cache\" />";
	lstrContents = lstrContents + "<meta http-equiv=\"Expires\" content=\"-1\" />";
	lstrContents = lstrContents + "<link rel=\"stylesheet\" href=\"/system/style/aviamagazine.css\" type=\"text/css\" />";
	lstrContents = lstrContents + "</head>";
	lstrContents = lstrContents + "<body style=\"background:#FFFFFF\">";
  	lstrContents = lstrContents + "<table id=\"ContentDivider\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td id=\"PrintContent\" width=\"100%\" valign=\"top\">" + lstrOrgineleContent + "</td></tr></table>";
	lstrContents = lstrContents + "</body>";
	lstrContents = lstrContents + "</html>";
	
	var printwindow = window.open("","","width=860,height=600,left=50,top=50,resizable=yes,scrollbars=yes");

	//var re1 = /584/i;
	//lstrContents = lstrContents.replace(re1,"720");

	re2 = /<A /i;
	re3 = />/i;
	re4 = /<\/A>/i;
	while (lstrContents.search(re2) > 0 )
	{
	
		startlinks = lstrContents.search(re2);
		string1 = lstrContents.substring(0, startlinks);
		string2 = '<SPAN class=print NOBR>' + ((lstrContents.substring(startlinks)).substring((lstrContents.substring(startlinks)).search(re3) + 1)).substring(0,((lstrContents.substring(startlinks)).substring((lstrContents.substring(startlinks)).search(re3) + 1)).search(re4)) + ((lstrContents.substring(startlinks)).substring((lstrContents.substring(startlinks)).search(re3) + 1)).substring(((lstrContents.substring(startlinks)).substring((lstrContents.substring(startlinks)).search(re3) + 1)).search(re4),((lstrContents.substring(startlinks)).substring((lstrContents.substring(startlinks)).search(re3) + 1)).search(re4)) + '</SPAN>'; // content binnen anchor tags
		string3 = lstrContents.substring(lstrContents.search(re4)+4);
		lstrContents = string1 + string2 + string3;
	}
	
	re2 = /<IFRAME /i;
	re4 = /<\/IFRAME>/i;
	while (lstrContents.search(re2) > 0 )
	{
	    startlinks = lstrContents.search(re2);
		string1 = lstrContents.substring(0, startlinks);
		string3 = lstrContents.substring(lstrContents.search(re4)+9);
		lstrContents = string1 + string3;
	}

	printwindow.document.write(lstrContents);
	printwindow.document.close();
    printwindow.print();
}



/* Bepaal de browser breedte afhankelijk van browsertype */
//function fWidth()
//{
//	if (self.innerWidth)
//	{
//		return self.innerWidth;
//	}
//	else if (document.documentElement && document.documentElement.clientWidth)
//	{
//		return document.documentElement.clientWidth;
//	}
//	else if (document.body)
//	{
//		return document.body.clientWidth;
//	}
//	else return;
//}


// bepalen van de maand. gebruik in het menu om juiste file te laden.			
//			now = new Date();
//			var CurrentMonth = (now.getMonth()+1);


//Versie 1.1 toevoeging tbv google CSE
function clearText()
{ 
    document.getElementById("ctl00_q").className  = "SearchBoxActive"; 
    document.aspnetForm.ctl00_q.value = "";
} 

            
function resetText()
{ 
    if(document.aspnetForm.ctl00_q.value == "") 
    {
        document.getElementById("ctl00_q").className  = "SearchBox"; 
        document.aspnetForm.ctl00_q.value = "Google Custom Search";
    }
}     

