
function size_factor() {
	var HF = (screen.height/1024);
	var WF = (screen.width/1280);
	var SF = 1;
	
	if(HF == WF) SF = HF;
	else SF = Math.min(HF, WF);
	
	if(SF > 1) SF = 1;
	
	return SF;
}

function loadImage(img_name, img_width, img_height, img_src) {
	
	img_name=new Image(Math.ceil(img_width*size_factor()),Math.ceil(img_height*size_factor())); img_name.src=img_src;
}

function writeImageTag(img_src, img_width, img_height) {
	
	document.write("<img src=\""+img_src+"\" width=\""+Math.ceil(img_width*size_factor())+"\" height=\""+Math.ceil(img_height*size_factor())+"\" alt=\"\" />");
	
}

function writeMapImageTag(img_src, img_width, img_height, img_name, img_usemap) {
	
	document.write("<img name=\""+img_name+"\" usemap=\"#"+img_usemap+"\" src=\""+img_src+"\" width=\""+Math.ceil(img_width*size_factor())+"\" height=\""+Math.ceil(img_height*size_factor())+"\" alt=\"\" border=\"0\" />");
	
}

function writeRectMapAreaTag(x1, y1, x2, y2, href, target, img_name, onMouseOver_src, onMouseOut_src) {
	
	document.write("<area shape=\"rect\" coords=\""+Math.ceil(x1*size_factor())+","+Math.ceil(y1*size_factor())+","+Math.ceil(x2*size_factor())+","+Math.ceil(y2*size_factor())+"\" href=\""+href+"\" target=\""+target+"\" onMouseOver=\""+img_name+".src=\'"+onMouseOver_src+"\'\" onMouseOut=\""+img_name+".src=\'"+onMouseOut_src+"\'\" />");
	
}

function writeLinkImageTag(href, target, img_name, onMouseOver_src, img_src, img_width, img_height) {
	
document.write("<a href=\""+href+"\" target=\""+target+"\" onMouseOver=\""+img_name+".src=\'"+onMouseOver_src+"\'\" onMouseOut=\""+img_name+".src=\'"+img_src+"\'\"><img src=\""+img_src+"\" alt=\"\" border=\"0\" width=\""+Math.ceil(img_width*size_factor())+"\" height=\""+Math.ceil(img_height*size_factor())+"\"   name=\""+img_name+"\"/></a>");
}

function setupWN(wn_width, wn_height) {
	
document.write("<style type=\"text/css\">");
document.write("div#wn	{");
document.write("position:relative;");

document.write("width:"+Math.ceil(wn_width*size_factor())+"px; height:"+Math.ceil(wn_height*size_factor())+"px; ");

document.write("overflow:hidden;");
document.write("}");
document.write("</style>");
}

function writeClassImageTagVertical(class_name, img_src, img_name, img_width, img_height){

document.write("<a class=\""+class_name+"\" href=\"#\"><img src=\""+img_src+"\" name=\""+img_name+"\" alt=\"\" border=\"0\" width=\""+Math.ceil(img_width*size_factor())+"\" height=\""+Math.ceil(img_height*size_factor())+"\" /></a>");
}

function writeClassImageTagHorizontal(class_name, scroll_width, speed, img_src, img_width, img_height){

document.write("<a class=\""+class_name+"_"+Math.ceil(scroll_width*size_factor())+"_"+speed+"\" href=\"#\"><img src=\""+img_src+"\" alt=\"\" border=\"0\" width=\""+Math.ceil(img_width*size_factor())+"\" height=\""+Math.ceil(img_height*size_factor())+"\" /></a>");
}

