﻿function openWindow(fileName,nHorse)
{
	/*//alert("filename is "+fileName);
	var w = 630;
	var h = 228;
	var winl = 0;
	var wint = 0;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=0,resizable=0,menubar=0,status=0' ;
	title = 'AEC' ;
	win = window.open(fileName +"?hId="+nHorse, title, winprops);
	if(win) {
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}*/
	//popImage(fileName,'')

	PositionX = 0;
	PositionY = 0;
	
	defaultWidth  = 600;
	defaultHeight = 600;

	opt= "scrollbars=no,width=" + defaultWidth + ",height=" + defaultHeight + ",left=" + PositionX + ",top=" + PositionY;	
	imgWin = window.open("about:blank","",opt);
	
	with (imgWin.document) {
		writeln("<html><head><title>" + fileName + "</title><style>body{background:#d8d8d8;margin:0;}</style>");
		writeln("<sc" + "ript>");
		writeln("var nav = (navigator.appName == \"Netscape\") ? true : false;");
		writeln("function resize(){");
		writeln("if(nav){");
		writeln("resizeTo(document.getElementById(\"horse\").width + 47,document.getElementById(\"horse\").height + 94)}");
		writeln("else{");
		writeln("resizeTo(document.getElementById(\"horse\").width + 50,document.getElementById(\"horse\").height + 95)}");
		writeln("}");
		writeln("</sc" + "ript>");
		writeln("</head><body onload=\"javascript:resize()\" style=\"overflow:hidden;\">");
		writeln("<table width=\"100%\" height=\"100%\"><tr><td align=\"center\" valign=\"middle\"><img id=\"horse\" src=" + fileName + " style=\"display:block;\"></td></tr></table></body></html>");
		close();
	}
}

function getParams()
{
	
	var query = top.location.search;
	var horse_pdf = "";
	if (query.indexOf("=") > 0)
		horse_pdf = query.substring (query.indexOf("=") + 1, query.length);
	return horse_pdf
	//alert("getParams= "+horse_pdf)
}

function loadPages(page1, page2)
{

	hourse_desc.location.href = page2;
	horse_top.location.href = '../top_horses.html?horse='+ page1;
	return false;

}

