
function RollOverOn(target) {

	if (document.images) {
		if (typeof (target) == "string") {
			if (typeof (eval(document[target])) == "object") {
				document[target].src = this.OnImage.src;
			}
		} else if (typeof (target) == "object") {
			target.src = this.OnImage.src;
		}
	}
	this.State = "ON";
}

function RollOverOff(target) {

	if (document.images) {
		if (typeof (target) == "string") {
			if (typeof (eval(document[target])) == "object") {
				document[target].src = this.OffImage.src;
			}
		} else if (typeof (target) == "object") {
			target.src = this.OffImage.src;
		}
	}
	this.State = "OFF";
}

function RollOverToggle(target) {

	// change state attribute
	if (this.State == "OFF")
		this.On(target)
	else
		this.Off(target);
}

// MAIN RollOver object
function RollOver(OffSrc, OnSrc) {

	if (document.images) {
		// create on object for the 'Off' state
		this.OffImage = new Image();
		// initialize 'off' property object
		this.OffImage.src = OffSrc;

		// create on object for the 'On' state
		this.OnImage = new Image();
		// initialize 'on' property object
		this.OnImage.src = OnSrc;
	}

	// initialize attributes
	this.State = "OFF";

	// set up methods for 'On', 'Off', and 'Toggle'
	this.Off = RollOverOff;
	this.On = RollOverOn;
	this.Toggle = RollOverToggle;
}

function fun(wUrl,wWidth,wHeight,num)
	{

	var maxWidth;

	//if (wWidth>470) 
		maxWidth=wWidth; 
	//else 	
	//	{maxWidth=470; }


	var variable_string="toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + (wWidth+120) + ",height=" + (wHeight+120) + ",dependent=no";
	the_name="template" + num;
	the_win=window.open(wUrl,the_name,variable_string);

	}