var interfaceimg=new Array()
function preloadimg(){
for (i=0;i<arguments.length;i++){
interfaceimg[i]=new Image()
interfaceimg[i].src=arguments[i]
}
}

preloadimg("/images/bluetab.jpg", "/images/bluetabover.jpg")

var initialtab=[1, "sc1"]

var turntosingle=0 //0 for no (default), 1 for yes

var disabletablinks=0 //0 for no (default), 1 for yes
 
var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function expandcontent(cid, aobject){
if (disabletablinks==1)
aobject.onclick=new Function("return false")
if (document.getElementById && turntosingle==0){
highlighttab(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
}
}

function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collectddimagetabs()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
}

function collectddimagetabs(){
var tabobj=document.getElementById("ddimagetabs2")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){
    try
    {
    //preloadimg("/images/bluetab.jpg", "/images/bluetabover.jpg")
    collectddimagetabs()
    expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
    }
    catch(e)
    {
    }
}

//Variable IE Declaration
var isIE = (navigator.appName.indexOf("Internet Explorer") > 0) ? true : false;


//Opens Popout Calendar Window
function openCalendar(strCalendarParam) {
var handlerWindow = null;
var strPage = "/markets/general/popCalendar.aspx?formname=aspnetForm.ctl00$ContentPlaceHolder1$ctl00$" + strCalendarParam;
var iHeight = 190;
var iWidth = 210;
var sParameters = (isIE) ? ("toolbar=no,status=yes,scrollbars=no,left=" + ((screen.availWidth / 2) - (iWidth / 2)) + ",top=" + ((screen.availHeight / 2) - (iHeight / 2)) + ",height=" + iHeight + ",width=" + iWidth) : ("toolbar=no,status=no,scrollbars=yes,screenX=" + ((screen.availWidth / 2) - (iWidth / 2)) + ",screenY=" + ((screen.availHeight / 2) - (iHeight / 2)) + ",height=" + iHeight + ",width=" + iWidth);

handlerWindow = window.open(strPage, "SiteCredits", sParameters);

if (handlerWindow != null)
	handlerWindow.focus();
else
	self.location = strPage;
}

function PopWindowAll(strPage, iHeight, iWidth)
{
	var handlerWindow = null;
	
	sParameters = (isIE) ? ("location=yes,toolbar=yes,status=yes,scrollbars=yes,left=0" + ",top=0"  + ",height=" + iHeight + ",width=" + iWidth) : ("toolbar=yes,status=yes,scrollbars=yes,screenX=" + ((screen.availWidth)) + ",screenY=" + ((screen.availHeight)) + ",height=" + iHeight + ",width=" + iWidth);  	    
	handlerWindow = window.open(strPage, "SiteCredits", sParameters);

	if (handlerWindow != null)
		handlerWindow.focus();
	else
		self.location = strPage;
}

function GoogleMap(strPage, iHeight, iWidth)
{
	var handlerWindow = null;
	sParameters = (isIE) ? ("location=no,toolbar=no,status=no,scrollbars=no,left=0" + ",top=0"  + ",height=" + iHeight + ",width=" + iWidth) : ("toolbar=yes,status=yes,scrollbars=yes,screenX=" + ((screen.availWidth)) + ",screenY=" + ((screen.availHeight)) + ",height=" + iHeight + ",width=" + iWidth);  	    
	handlerWindow = window.open(strPage, "LocationView", sParameters);

	if (handlerWindow != null)
		handlerWindow.focus();
	else
		self.location = strPage;
}

function MapPointMap(strPage, iHeight, iWidth)
{
	var handlerWindow = null;
	sParameters = (isIE) ? ("location=no,toolbar=no,status=no,scrollbars=no,left=0" + ",top=0"  + ",height=" + iHeight + ",width=" + iWidth) : ("toolbar=yes,status=yes,scrollbars=yes,screenX=" + ((screen.availWidth)) + ",screenY=" + ((screen.availHeight)) + ",height=" + iHeight + ",width=" + iWidth);  	    
	handlerWindow = window.open(strPage, "LocationView", sParameters);

	if (handlerWindow != null)
		handlerWindow.focus();
	else
		self.location = strPage;
}

function PopWindow(strPage, popH, popW)
{
    var handlerWindow = null;
    var w, h;
    
    if (document.all || document.layers) {
        w = screen.availWidth;
        h = screen.availHeight;
    }

    if(popH == null)
	    popH = 600;
	if(popW == null)
	    popW = 800;
	
    var leftPos = (w-popW)/2, topPos = 0;

	sParameters = (isIE) ? ("location=yes,toolbar=yes,status=yes,resizable=yes,scrollbars=yes,left=" + leftPos + ",top=" + topPos + ",height=" + popH + ",width=" + popW) : ("toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=" + leftPos + ",screenY=" + topPos + ",height=" + popH + ",width=" + popW);  	    
	handlerWindow = window.open(strPage, "SiteHelp", sParameters);

	if (handlerWindow != null)
		handlerWindow.focus();
	else
		self.location = strPage;
}

function PopWindowMsg(strPage, popH, popW)
{
    var handlerWindow = null;
    var w, h;
    
    if (document.all || document.layers) {
        w = screen.availWidth;
        h = screen.availHeight;
    }

    if(popH == null)
	    popH = 600;
	if(popW == null)
	    popW = 800;
	
    var leftPos = (w-popW)/2, topPos = 0;

	sParameters = (isIE) ? ("location=no,toolbar=no,status=no,resizable=no,scrollbars=no,left=" + leftPos + ",top=" + topPos + ",height=" + popH + ",width=" + popW) : ("toolbar=no,status=no,resizable=yes,scrollbars=yes,screenX=" + leftPos + ",screenY=" + topPos + ",height=" + popH + ",width=" + popW);  	    
	handlerWindow = window.open(strPage, "", sParameters);

	if (handlerWindow != null)
		handlerWindow.focus();
	else
		self.location = strPage;
}

function BuyNow(iProductID)
{
	PopWindow("/Markets/General/BuyNow.aspx?List=" + iProductID, 600, 800);
}
function BuyNowPP(iProductID)
{
	PopWindow("/Markets/General/BuyNowConfirmPP.aspx?List=" + iProductID, 600, 800);
}
function Edirection_Pay(iProductID)
{
	PopWindow("/Markets/General/pay_edirection.aspx?p=i&List=" + iProductID, 600, 800);
}
function Edirection_PayBusiness(iProductID)
{
	PopWindow("/Markets/General/pay_edirection.aspx?p=s&List=" + iProductID, 600, 800);
}
function emaillisting(iProductID)
{
	PopWindow("/Markets/General/emaillisting.aspx?List=" + iProductID, 500, 800);
}