﻿top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
	
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}

function showHideRow(rowID, OpenerID, ClassOn, ClassOff){
	var obj=(document.all) ? document.all[rowID] : document.getElementById(rowID);
	var objOpener=(document.all) ? document.all[OpenerID] : document.getElementById(OpenerID);
	
    obj.style.display=(obj.style.display=="block"?"none":"block");
	objOpener.className=(objOpener.className==ClassOff?ClassOn:ClassOff);
}

function verifyRowClassChange(parentID, childID, targetClass) {
	var objChild =(document.all) ? document.all[childID] : document.getElementById(childID);
	var objParent =(document.all) ? document.all[parentID] : document.getElementById(parentID);
	
	if (objChild.style.display == "none") {
		objParent.className = targetClass;
	}
}
function showHideObject(objectID) {
	var obj=(document.all) ? document.all[objectID] : document.getElementById(objectID);
    obj.style.display=(obj.style.display=="block"?"none":"block");
}

// Function to fix URL paths
function FixURL(strURL, strPathToRoot)
{
	// If there's a need for optimization
	if (strURL.indexOf("/") != 0 && strURL.indexOf("http://") != 0)
	{	
		// Fix URLs beginning with www (misuse of full path URL)
		if (strURL.indexOf("www.") == 0)
		{
			strURL = "http://" + strURL;
		} 
		// Fix URLs attempting to make use of relative URLs
		else if (strURL.value != "")
		{
			strURL = strPathToRoot + strURL;
		}
	}
	
	// Return optimized URL
	return strURL;
}

function printtrack(track_id,strLng)
{
	window.open("track_info_print.asp?lng="+strLng+"&track_id="+track_id,"trackprint","toolbar=0,location=0,status=1,menubar=1,scrollbars=yes,resizable=1,width=680,height=700");

}

function popupprint(track_id,strLng)
{
	window.open("pop_up_print.asp?lng="+strLng+"&track_id="+track_id,"trackprint","toolbar=1,location=0,status=0,menubar=0,scrollbars=yes,resizable=1,width=765,height=800");
}


function printflower(flower_id, strLng)
{
	window.open("flower_info_print.asp?lng="+strLng+"&flower_id="+flower_id,"flowerprint","toolbar=0,location=0,status=1,menubar=1,scrollbars=yes,resizable=1,width=680,height=700");
}

function printanimal(animal_id, strLng)
{
	window.open("animal_info_print.asp?lng="+strLng+"&animal_id="+animal_id,"animalprint","toolbar=0,location=0,status=1,menubar=1,scrollbars=yes,resizable=1,width=680,height=700");
}
function PopupPic(sPicURL,sPicName,sCopyRight) 
{ 
	var wd = 600;
	var ht = 350;
	var d = ((screen.width-wd)/2);
	var h = ((screen.height-ht)/2);
    myWindow=window.open('popup-pic.asp?URL='+sPicURL+'&name='+sPicName+'&copyright='+sCopyRight,'popupImage','top='+h+',left='+d+',width='+wd+',height='+ht+',toolbar=no,location=no,directories=no,menubar=no,status=yes,scrollbars=auto,resizable=no');
	myWindow.focus()
}

