var popbackground="white";
var windowtitle="Image";
var imagesShown=0;
var t;
picfiles = new Array("3m.jpg", "acer.jpg", "adobe.gif", "amd.jpg", "aml.jpg", "apc.jpg", "ascii.jpg", "astaro.jpg", "avaya.jpg", "belkin.jpg", "bic.gif", "brother.gif", "cablestogo.jpg", "ca-pos.jpg", "canon.gif", "cisco.gif", "citizen.jpg", "dell.gif", "dymo.gif", "fellowes.gif", "fujitsu.jpg", "gateway.png", "hp.jpg", "ibm.jpg", "imation.gif", "infocus.jpg", "intel.jpg", "intermec.jpg", "intuit.jpg", "iomega.png", "konicaminolta.jpg", "lenovo.jpg", "lexmark.jpg", "Maxell.PNG", "mcafee.gif", "ms.jpg", "nec.jpg", "nortel.jpg", "novell.jpg", "nsc-pos.jpg", "okidata.jpg", "oneil.jpg", "optoma.jpg", "oracle.gif", "panasonic.jpg", "pilot.gif", "planar.jpg", "plantronics.gif", "psion.jpg", "qualitypark.gif", "ricoh.gif", "samsung.jpg", "seagate.jpg", "software_logo.jpg", "sonystorage.jpg", "symantec.jpg", "targus.jpg", "tdk.gif", "trendmicro.jpg", "tripplite.jpg", "tsd.jpg", "vaio.jpg", "verbatim.jpg");
picalts = new Array("3M", "Acer", "Adobe", "AMD", "AML", "APC", "ASCII", "Astaro", "Avaya", "Belkin", "BIC", "Brother", "CablesToGo", "Computer Associates", "Canon", "Cisco", "Citizen", "Dell", "Dymo", "Fellowes", "Fujitsu", "Gateway", "HP", "IBM", "Imation", "InFocus", "Intel", "Intermec", "Intuit", "Iomega", "Konica Minolta", "Lenovo", "Maxell", "McAfee", "Microsoft", "NEC", "Nortel", "Novell", "National Service Center", "Okidata", "O'Neil", "Optoma", "Oracle", "Panasonic", "Pilot", "Planar", "Plantronics", "Psion Teklogix", "Quality Park", "Ricoh", "Samsung", "Seagate", "Software Innovations", "Sony Storage", "Symantec", "Targus", "TDK", "Trend Micro", "Tripplite", "TSD", "VAIO", "Verbatim");
function detectexist(obj){
	return (typeof obj !="undefined")
}

function popimage(imgpath, popwidth, popheight, textdescription){

function getpos(){
	leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0;
	toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0;
	if (window.opera){
		leftpos-=screenLeft;
		toppos-=screenTop;
	}
}
getpos();
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,scrollbars=yes,left='+leftpos+',top='+toppos;
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"';
if (typeof popwin=="undefined" || popwin.closed) popwin=window.open("","",winattributes);
else {
	popwin.resizeTo(popwidth, popheight+30);
}
popwin.document.open();
popwin.document.write('<html><title>'+windowtitle+'</title><body '+bodyattribute+'><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br>'+textdescription+'</body></html>');
popwin.document.close();
popwin.focus();
}

function preloadMPImages() {
	if (document.images) {
		pic = new Array();
		picw = new Array(81,61,50,69,54,57,61,95,72,100,110,78,119,91,52,50,90,91,75,73,61,90,52,51,110,79,54,80,61,75,60,77,70,86,90,76,58,68,74,63,81,96,100,83,105,81,77,110,110,43,109,65,85,84,117,92,53,75,86,61,70,68,119);
		pich = new Array(35,35,50,35,35,35,35,35,35,35,66,20,35,22,35,47,35,24,35,24,35,52,44,35,66,29,35,35,35,64,70,35,35,35,22,35,35,35,35,41,35,35,31,15,35,24,35,66,35,32,30,35,35,35,35,35,35,35,35,35,35,35,36);
		for (x=0;x<picfiles.length;x++) {
			pic[x]= new Image(picw[x],pich[x]); 
			pic[x].src="images/logos/"+picfiles[x]; 
		}
	}
}

function imgBrowse(dir,auto){
imagesShown+=dir;
if (imagesShown == -1) imagesShown = 20;
if (imagesShown == 21) imagesShown = 0;
$("#browseImages1").attr({
"src":"images/logos/"+picfiles[3*imagesShown],
"alt":picalts[3*imagesShown]
});
$("#browseImages2").attr({
"src":"images/logos/"+picfiles[(3*imagesShown)+1],
"alt":picalts[(3*imagesShown)+1]
});
$("#browseImages3").attr({
"src":"images/logos/"+picfiles[(3*imagesShown)+2],
"alt":picalts[(3*imagesShown)+2]
});
if (auto==1) { 
	t=setTimeout("imgBrowse(1,1);",2000);
} else {
	clearTimeout(t);
}
}

newsShown = 1;

function newsBrowse(dir){
if ($("#newsList").html()) {
switch (dir) {
case 0:
newsShown = 0;
break;
case -1:
newsShown = (newsShown==0)?$("#newsList > div").length-1:newsShown-1;
location.hash = "#top";
break;
case 1:
newsShown = (newsShown==$("#newsList > div").length-1)?0:newsShown+1;
location.hash = "#top";
break;
}
if ($("#newsList > div").eq(newsShown)) $("#newsFrame").html($("#newsList > div").eq(newsShown).html());
}
}

var ecX;
var ecY;
$(document).mousemove(function(e) {
ecX = e.pageX;
ecY = e.pageY;
});

$(document).ready(function() {
//if (window.name == "GOPD") window.close();
$("#catsearch").value="Search our catalog";
if ($("#newsFrame").html()) newsBrowse(0);
if ($("#browseImages1").html()) t=setTimeout("imgBrowse(1,1);",2000);
preloadMPImages();
$("#catalogLink").attr({
"href":"javascript:;",
"target":""
});
$("#catalogLink").click(function (){ 
window.open("http://www.op247.com/?actID=8497", "RCpage","toolbar=1,scrollbars=1,location=0,statusbar=1,menubar=1,resizable=1,width=800,height=685,left=30,top=225");
});
slh = $(".sidelinks").height();
lsh = $(".leftside").height();
if (lsh > slh) {
$(".sidelinks").height(lsh);
} else {
$(".leftside").height(slh);
}
});