


// A little script to check if buttons has been pressed more than once.
// It makes it impossible to click on more than one button.
// It's handy if it's a button that posts data.
// Usage:   onclick="javascript:return checkSubmit()"
var asSubmitCount = 0;
function checkSubmit() {
	asSubmitCount++;
	return (asSubmitCount == 1);
}







// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
/*
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) 
{
   for(var i=0; i<document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}
*/


function MailThisPage() {
	window.open('MailFriend.aspx?Target=' + window.location.href, 'mail', 'bar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=800,height=600,screenX=0,left=0,screenY=0,top=0');
}


function InsertObjectToDocument(toDocument, insertObject)
{
    toDocument.write(insertObject); 
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function AlienTrick_showHideLayers() {
  var i,p,v,obj,args=Alientrick_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function win_old(fileName,WindowName) {
    
    var Img = new Array();
	// create a new image, include its
	// (width, height), width & height
	// used to size new window
	Img[0] = new Image;//(300,100)
	// the path to the picture
	Img[0].src = fileName;
	//alert(fileName);
		
	newWidth=0;
	newHeight=0;
	var iNum = 0;
	newWidth = Img[iNum].width;
    newHeight = Img[iNum].height;
    //centerX = (screen.width - Img[iNum].width)/2;
    //centerY = (screen.height - Img[iNum].height)/2;
    
    if (newWidth==0)
    {
    newWidth=500;
    }
	
	if(newHeight==0)
	{
	newHeight=500;
	}
	
	
    centerX = (screen.availWidth - newWidth)/2;
    centerY = (screen.availHeight - newHeight)/2;
    
    //centerX = (screen.availWidth - Img[iNum].width)/2;
    //centerY = (screen.availWidth - Img[iNum].height)/2;
    
       
    winSet = "\"scrollbars=no,resizable=no,status=no,location=no,menubar=no,screenX=" + centerX + ",screenY=" + centerY + ",width=" + newWidth + ",height=" + newHeight + "\"";
    
    //winSet = "\"scrollbars=no,resizable=no,status=no,location=no,menubar=no,screenX=0,screenY=0,width=" + newWidth + ",height=" + newHeight + "\""
    ////winSet = "scrollbars=no,resizable=no,status=no,location=no,menubar=no,screenX=" + centerX + ",screenY=" + centerY + ",width=" + newWidth + ",height=" + newHeight
    
    //newWindow = open("",imgNum,winSet);
    
    
    var t = ''; 
	var theWindow;
	//window.close('Foto_Groot')
	
	//theWindow = window.open('',WindowName,'bar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + newWidth + ',height=' + newHeight + ',screenX=0,left=' + (screen.availWidth-newWidth)/2 + ',screenY=0,top=' + (screen.availHeight-newHeight)/2 + '');
	
	//theWindow = window.open('','Foto_Groot','bar=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=newWidth,height=newHeight,screenX=0,left=' + (screen.availWidth-newWidth)/2 + ',screenY=0,top=' + (screen.availHeight-newHeight)/2 + '');
	
	theWindow = window.open('',WindowName,winSet)
	t += "<html>\n";
	t += "<head>\n";
	//t += "<meta NAME='GENERATOR' Content='Microsoft Visual Studio 6.0'>\n";
	t += "<title> </title>\n";
	t += "</head>\n";
	t += "<body bgcolor='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>\n";
	t += "<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'>\n";
	t += "<tr>\n";
    t += "<td align='middle' valign='center'>\n";
	t += "<div align='center'><A HREF=\'javascript:self.close()\' onmouseover=\'window.status=close\; return true\'><IMG SRC='" + fileName + "' BORDER=0 TITLE=\'\'></A></div>\n";
        
    
    t += "</td>\n";
	t += "</tr>\n";
	t += "</table>\n";
	t += "</body>\n";
	t += "</html>\n";
	
	theWindow.document.clear();
	theWindow.document.write(t);
    theWindow.focus();
    
}
function win(fileName,WindowName) {
// ===============================
// Set the horizontal and vertical position for the popup
PositionX = 100;
PositionY = 100;
// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth  = 500;
defaultHeight = 500;
// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows
var AutoClose = true;
// ================================

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

imageURL=fileName;
imageTitle=WindowName;

if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src="'+imageURL+'" style="display:block"></body></html>');
close();		
}}


/*
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values defined in globals
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasReqestedVersion ) {
	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
	// DO NOT MODIFY THE FOLLOWING FOUR LINES
	// Location visited after installation is complete if installation is required
	alert("Need Update");
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
	document.title = document.title.slice(0, 47) + " - Flash Player Installation";
	var MMdoctitle = document.title;

	AC_FL_RunContent(
		"src", "playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
		"width", "550",
		"height", "300",
		"align", "middle",
		"id", "detectionExample",
		"quality", "high",
		"bgcolor", "#3A6EA5",
		"name", "detectionExample",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
	
	
} else if (hasReqestedVersion) {
alert("Correct version");
	// if we've detected an acceptable version
	// embed the Flash Content SWF when all tests are passed
	//AC_FL_RunContent(
	//		"src", "example",
	//		"width", "550",
	//		"height", "200",
	//		"align", "middle",
	//		"id", "detectionExample",
	//		"quality", "high",
	//		"bgcolor", "#FFFFFF",
	//		"name", "detectionExample",
	//		"allowScriptAccess","sameDomain",
	//		"type", "application/x-shockwave-flash",
	//		'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',
	//		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	//);
} else {  // flash is too old or we can't detect the plugin
    alert("No flash");
	var alternateContent = 'Alternate HTML content should be placed here.<BR>'
	+ 'This content requires the Adobe Flash Player. '
	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
	document.write(alternateContent);  // insert non-flash content
}
*/
