﻿// JScript File

    function jumpToHomePage()
    {
	    setTimeout("location.href='entry.aspx';",10000);
    }
    function launchPopUp(url,intWidth,intHeight)
    {
        var ileft=(screen.width-intWidth)/2;
        var itop=(screen.height-intHeight)/2;
	    window.open(url,"win",'top=' + itop + ',left=' + ileft + ',width=' + intWidth + ',height=' + intHeight + ',toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1');	
    }
    function RedirectHome()
    {
	    setTimeout("location.href='entry.aspx';",5000);
    }
    function LogoScrollCheck()
    {
	    var strUserAgent = String(navigator.userAgent);
		
	    if(document.aspnetForm.ctl00$MKCPAGECONTENT$LogoScroll.value=="true" && strUserAgent.indexOf("Mac")==-1)
	    {
		    document.aspnetForm.ctl00$MKCPAGECONTENT$LogoScroll.value = "false";
		    location.href='#logosall';
	    }				
    }
	
    function PreviewScrollCheck()
    {
	    var strUserAgent = String(navigator.userAgent);
		
	    if(document.aspnetForm.ctl00$MKCPAGECONTENT$PreviewScroll.value=="true" && strUserAgent.indexOf("Mac")==-1)
	    {
		    document.aspnetForm.ctl00$MKCPAGECONTENT$PreviewScroll.value = "false";
		    location.href='#checkpreview';
	    }				
    }
	
    function SelectLogo(strImageName,intImageID)
    {
	    document["selectedlogo"].width = document[strImageName].width;	
	    document["selectedlogo"].height = document[strImageName].height;				
	    document["selectedlogo"].src = document[strImageName].src;	
	    document.aspnetForm.ctl00$MKCPAGECONTENT$selectedImage.value = intImageID;
    }
			
    function ClearLogo()
    {
	    document.aspnetForm.ctl00$MKCPAGECONTENT$selectedImage.value = "";
	    document["selectedlogo"].width = 70;	
	    document["selectedlogo"].height = 70
	    document["selectedlogo"].src = "images/spacer.gif"		
    }
	
    function ClearMonogramSelection()
    {
	    document.aspnetForm.ctl00$MKCPAGECONTENT$PersonalizeItList.selectedIndex = 0;
	    document.aspnetForm.ctl00$MKCPAGECONTENT$PersonalizeItMonogramChoice[0].checked = false;
	    document.aspnetForm.ctl00$MKCPAGECONTENT$PersonalizeItMonogramChoice[1].checked = false;
    }
	
    function doInitPopupEvents()
    {
	    // Determine if we have a control to set the focus to
	    if(document.aspnetForm.ctl00$MKCPAGECONTENT$ControlWithFocus.value > '')
		    eval("document.aspnetForm.ctl00$MKCPAGECONTENT$" + document.aspnetForm.ctl00$MKCPAGECONTENT$ControlWithFocus.value + ".focus();");
    }
    function launchCloseup(strID)
    {
        var ileft=(screen.width-650)/2;
        var itop=(screen.height-625)/2;
	    window.open('productcloseup.aspx?productid=' + strID,'ProductCloseup','top=' + itop + ',left=' + ileft + ',width=650,height=625,resizable=yes,scrollbars=yes');
    }
    		
    function AlertOverSizeItem()
    {
        if('<%= HttpContext.Current.Session("OverSizeWithPO") %>'=="True")
        {
            alert('There are items in your order that cannot be delivered to a P.O. Box.  Please click "edit" to change your shipping address.   For more information, visit the Help Page.');
        }
    }

