var activePage, subActivePage, imageLoad = 0;
var newWindow, fairNewWindow, wallNewWindow;

function LoadImages() {
	productson = new Image(); productson.src = "images/mainLinks_1_f2.gif";
	productsoff = new Image(); productsoff.src = "images/mainLinks_1.gif";
	sulfeton = new Image(); sulfeton.src = "images/mainLinks_3_f2.gif";
	sulfetoff = new Image(); sulfetoff.src = "images/mainLinks_3.gif";
	contacton = new Image(); contacton.src = "images/mainLinks_4_f2.gif";
	contactoff = new Image(); contactoff.src = "images/mainLinks_4.gif";
	englishon = new Image(); englishon.src = "images/mainLinks_5_f2.gif";
	englishoff = new Image(); englishoff.src = "images/mainLinks_5.gif";

	if (activePage == "products") {
		scorpionon = new Image(); scorpionon.src = "images/productsLinks_1_f2.gif";
		scorpionoff = new Image(); scorpionoff.src = "images/productsLinks_1.gif";
		expresson = new Image(); expresson.src = "images/productsLinks_2_f2.gif";
		expressoff = new Image(); expressoff.src = "images/productsLinks_2.gif";
		dynamicon = new Image(); dynamicon.src = "images/productsLinks_3_f2.gif";
		dynamicoff = new Image(); dynamicoff.src = "images/productsLinks_3.gif";
		leatheron = new Image(); leatheron.src = "images/productsLinks_4_f2.gif";
		leatheroff = new Image();leatheroff.src = "images/productsLinks_4.gif";
		dryeron = new Image(); dryeron.src = "images/productsLinks_5_f2.gif";
		dryeroff = new Image(); dryeroff.src = "images/productsLinks_5.gif";
		exposureon = new Image(); exposureon.src = "images/productsLinks_6_f2.gif";
		exposureoff = new Image(); exposureoff.src = "images/productsLinks_6.gif";
		screenon = new Image(); screenon.src = "images/productsLinks_7_f2.gif";
		screenoff = new Image(); screenoff.src = "images/productsLinks_7.gif";
		sockson = new Image(); sockson.src = "images/productsLinks_8_f2.gif";
		socksoff = new Image(); socksoff.src = "images/productsLinks_8.gif";
		paintMixeron = new Image(); paintMixeron.src = "images/productsLinks_9_f2.gif";
		paintMixeroff = new Image(); paintMixeroff.src = "images/productsLinks_9.gif";
		squeegeeGrinderon = new Image(); squeegeeGrinderon.src = "images/productsLinks_10_f2.gif";
		squeegeeGrinderoff = new Image(); squeegeeGrinderoff.src = "images/productsLinks_10.gif";
		flokon = new Image(); flokon.src = "images/productsLinks_11_f2.gif";
		flokoff = new Image(); flokoff.src = "images/productsLinks_11.gif";
	}

	if (activePage == "sulfet") {
		presidenton = new Image(); presidenton.src = "images/sulfetLinks_1_f2.gif";
		presidentoff = new Image(); presidentoff.src = "images/sulfetLinks_1.gif";
		missionon = new Image(); missionon.src = "images/sulfetLinks_2_f2.gif";
		missionoff = new Image(); missionoff.src = "images/sulfetLinks_2.gif";
		historyon = new Image(); historyon.src = "images/sulfetLinks_3_f2.gif";
		historyoff = new Image(); historyoff.src = "images/sulfetLinks_3.gif";
		newson = new Image(); newson.src = "images/sulfetLinks_4_f2.gif";
		newsoff = new Image(); newsoff.src = "images/sulfetLinks_4.gif";
		fairson = new Image(); fairson.src = "images/sulfetLinks_5_f2.gif";
		fairsoff = new Image(); fairsoff.src = "images/sulfetLinks_5.gif";
		humanon = new Image(); humanon.src = "images/sulfetLinks_6_f2.gif";
		humanoff = new Image(); humanoff.src = "images/sulfetLinks_6.gif";
		wallpaperson = new Image(); wallpaperson.src = "images/sulfetLinks_9_f2.gif";
		wallpapersoff = new Image(); wallpapersoff.src = "images/sulfetLinks_9.gif";
	}

	if (activePage == "contact") {
		arrivalon = new Image(); arrivalon.src = "images/contactLinks_1_f2.gif";
		arrivaloff = new Image(); arrivaloff.src = "images/contactLinks_1.gif";
		onlineContacton = new Image(); onlineContacton.src = "images/contactLinks_2_f2.gif";
		onlineContactoff = new Image(); onlineContactoff.src = "images/contactLinks_2.gif";
		requestFormon = new Image(); requestFormon.src = "images/contactLinks_3_f2.gif";
		requestFormoff = new Image(); requestFormoff.src = "images/contactLinks_3.gif";
	}

	if (activePage == "info") {
		productson = new Image(); productson.src = "../tr/images/mainLinks_1_f2.gif";
		productsoff = new Image(); productsoff.src = "../tr/images/mainLinks_1.gif";
		sulfeton = new Image(); sulfeton.src = "../tr/images/mainLinks_3_f2.gif";
		sulfetoff = new Image(); sulfetoff.src = "../tr/images/mainLinks_3.gif";
		contacton = new Image(); contacton.src = "../tr/images/mainLinks_4_f2.gif";
		contactoff = new Image(); contactoff.src = "../tr/images/mainLinks_4.gif";
		englishon = new Image(); englishon.src = "../tr/images/mainLinks_5_f2.gif";
		englishoff = new Image(); englishoff.src = "../tr/images/mainLinks_5.gif";
	}

	if (activePage == "mail") {
		productson = new Image(); productson.src = "../tr/images/mainLinks_1_f2.gif";
		productsoff = new Image(); productsoff.src = "../tr/images/mainLinks_1.gif";
		sulfeton = new Image(); sulfeton.src = "../tr/images/mainLinks_3_f2.gif";
		sulfetoff = new Image(); sulfetoff.src = "../tr/images/mainLinks_3.gif";
		contacton = new Image(); contacton.src = "../tr/images/mainLinks_4_f2.gif";
		contactoff = new Image(); contactoff.src = "../tr/images/mainLinks_4.gif";
		englishon = new Image(); englishon.src = "../tr/images/mainLinks_5_f2.gif";
		englishoff = new Image(); englishoff.src = "../tr/images/mainLinks_5.gif";
		arrivalon = new Image(); arrivalon.src = "../tr/images/contactLinks_1_f2.gif";
		arrivaloff = new Image(); arrivaloff.src = "../tr/images/contactLinks_1.gif";
		onlineContacton = new Image(); onlineContacton.src = "../tr/images/contactLinks_2_f2.gif";
		onlineContactoff = new Image(); onlineContactoff.src = "../tr/images/contactLinks_2.gif";
		requestFormon = new Image(); requestFormon.src = "../tr/images/contactLinks_3_f2.gif";
		requestFormoff = new Image(); requestFormoff.src = "../tr/images/contactLinks_3.gif";
		humanon = new Image(); humanon.src = "../tr/images/sulfetLinks_6_f2.gif";
		humanoff = new Image(); humanoff.src = "../tr/images/sulfetLinks_6.gif";
	}

	imageLoad = 1;

}

function rollon(image) {
	if (parseInt(navigator.appVersion.substring(0,1))>=3 && imageLoad == 1) {
		document[image].src = eval(image + "on.src");
   	}
}

function rolloff(image) {
   	if (parseInt(navigator.appVersion.substring(0,1))>=3 && imageLoad == 1) {
		document[image].src = eval(image + "off.src");
   	}
}

function control(activePage) {
  	if (document[activePage] && imageLoad == 1) {
		document[activePage].src = eval(activePage + "on.src");
		eval(activePage + "off.src =" + activePage + "on.src");
  	}
}

function control(subActivePage) {
  	if (document[subActivePage] && imageLoad == 1) {
		document[subActivePage].src = eval(subActivePage + "on.src");
		eval(subActivePage + "off.src =" + subActivePage + "on.src");
  	}
}

function openWindow(w,h,imageSource) {
	var sw = this.screen.availWidth, sh = this.screen.availHeight;
	var wl = Math.round((sw - w) / 2), wt = Math.round((sh - h) / 2);
	var param = 'width=' + w.toString() + ',height=' + h.toString() + ',left=' + wl.toString() + ',top=' + wt.toString() + ',resizable=no,status=no,scrollbars=no';
	newWindow = window.open("", "image", param);
	var newContent = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>SULFET ..:: Screen Printing Equipment ::..</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1254\"><link href=\"../images/sulfet.css\" rel=\"stylesheet\" type=\"text/css\"></head><body bgcolor=\"#EBEBEB\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"><table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td colspan=\"3\"><img src=\"../images/empty.gif\" width=\"1\" height=\"15\"></td></tr><tr><td colspan=\"3\"><div align=\"center\"><img src=\"" + imageSource + "\"></div></td></tr><tr><td colspan=\"3\"><img src=\"../images/empty.gif\" width=\"1\" height=\"40\"></td></tr><tr><td width=\"80%\" class=\"closeBar\">www.sulfet.com &#169;2001-2004 All Rights Reserved</td><td width=\"15%\" class=\"closeBar\"><a href=\"javascript:window.close();\"><img src=\"images/close.gif\" alt=\"Kapat\" width=\"80\" height=\"20\" border=\"0\"></a></td><td width=\"5%\" class=\"closeBar\"><img src=\"../images/empty.gif\" width=\"1\" height=\"20\"></td></tr><tr><td colspan=\"3\"><img src=\"../images/empty.gif\" width=\"1\" height=\"15\"></td></tr></table></body></html>";
	newWindow.document.write(newContent);
	newWindow.document.close();
	newWindow.focus();
}

function openFairWindow(htmlFile) {
	var h = this.screen.availHeight - 100;
	var param = 'width=616,height=' + h.toString() + ',left=0,top=0,resizable=no,status=no,scrollbars=yes';
	fairNewWindow = window.open(htmlFile, "fair", param);
	fairNewWindow.focus();
}

function openWallWindow(imageSource) {
	var h = this.screen.availHeight - 100;
	var param = 'width=816,height=' + h.toString() + ',left=0,top=0,resizable=yes,status=no,scrollbars=yes';
	wallNewWindow = window.open("", "wall", param);
	var newContent = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>SULFET ..:: Screen Printing Equipment ::..</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1254\"><link href=\"../images/sulfet.css\" rel=\"stylesheet\" type=\"text/css\"></head><body leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"><table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><img src=\"../images/empty.gif\" width=\"1\" height=\"15\"></td></tr><tr><td class=\"body\"><img src=\"../images/empty.gif\" width=\"15\" height=\"1\"><span class=\"bodyBold\">PC'de Masaüstü Resmi (Duvar Kağıdı) yapmak için;</span><br><img src=\"../images/empty.gif\" width=\"30\" height=\"1\">1. Farenin okunu imajın üzerine getirin.<br><img src=\"../images/empty.gif\" width=\"30\" height=\"1\">2. Farenin sağ tuşuna basın.<br><img src=\"../images/empty.gif\" width=\"30\" height=\"1\">3. Microsoft Internet Explorer kullanıyorsanız &quot;Masaüstü Resmi Olarak Ayarla&quot; komutunu seçin.</td></tr><tr><td><img src=\"../images/empty.gif\" width=\"1\" height=\"15\"></td></tr><tr><td><img src=\"" + imageSource + "\"></td></tr><tr><td><img src=\"../images/empty.gif\" width=\"1\" height=\"15\"></td></tr></table></body></html>";
	wallNewWindow.document.write(newContent);
	wallNewWindow.document.close();
	wallNewWindow.focus();
}