﻿// JScript File

function chgImg(imgPath) {
  if (document.images) {
    if (document.all)
    {
      document.getElementById('Photo').style.filter="blendTrans(duration=1)";
      document.getElementById('Photo').filters.blendTrans.Apply();
    }
    
    document.getElementById('Photo').src = imgPath;

    if (document.all)
    {
      document.getElementById('Photo').filters.blendTrans.Play();
    }
  }
}

function sPropState()
{
	if (document.getElementById('Country').selectedIndex != 223) {
		document.getElementById('StateBox').className = "showState";
		document.getElementById('StateBox').style.display = "block";
		document.getElementById('State').className = "hideState";
		document.getElementById('State').style.display = "none";
	}
	else {
		document.getElementById('StateBox').className = "hideState";
		document.getElementById('StateBox').style.display = "none";
		document.getElementById('State').className = "showState";
		document.getElementById('State').style.display = "block";
	}
}

function shipInfo() {
    if (document.getElementById('shipInfo').style.display == "none") {
        document.getElementById('shipInfo').style.display = "block";
    }
    else {
        document.getElementById('shipInfo').style.display = "none";
    }
}

function PopSized(url, width, height) {
	var windowWidth = parseInt(width) + 10;
	var windowHeight = parseInt(height) + 50;
	
	var positionX = (screen.width-windowWidth)/2;
	var positionY = (screen.height-windowHeight)/2;	

large_image_win = window.open("",'Pic','top='+ positionY +', left='+ positionX +', width=' + windowWidth + ', height=' + windowHeight + ',scrollbars=0,resizable=0');
large_image_win.document.close();
large_image_win.resizeTo(windowWidth, windowHeight);
large_image_win.document.writeln ("<html><head></head><body style='margin:0px;padding:0px;'><div > " +
								  "<p style=\"margin-bottom:0px;margin-top:0px\" align=center><img src="+url+" height="+height+" width="+width+"></p></div>" +
								  "</div></body></html>");
large_image_win.focus();

}

function cancelOrder() {
	var cf = confirm("Are you sure you want to cancel your order?");
	
	if (cf) {
	    document.getElementById('ctl00$ContentPlaceHolder1$isCancel').value = true;
		return true;
	}
	else {
	   return false;
	}
}

function sMi(obj) {
    if (document.getElementById(obj).style.display == "none") 
        document.getElementById(obj).style.display = "block";
    else if (document.getElementById(obj).style.display == "block")
        document.getElementById(obj).style.display = "none";
    else
        document.getElementById(obj).style.display = "block";
}


function getVideo(videoPath) {
    document.write('<OBJECT ID="myVideo" style="z-index:-1000;" width="340" height="320" type="application/x-mplayer2">\n');
    document.write('<PARAM NAME="FileName" VALUE="' + videoPath + '">\n');
    document.write('<PARAM NAME="ShowControls" VALUE="True">\n');
    document.write('<PARAM NAME="ShowStatusBar" VALUE="True">\n');
    document.write('<PARAM NAME="TransparentAtStart" Value="True">\n');
    document.write('<PARAM NAME="AutoStart" Value="True">\n');
    document.write('<PARAM NAME="SendPlayStateChangeEvents" VALUE=True>\n');
    document.write('<PARAM NAME="AnimationatStart" Value="True">\n');
    document.write('<PARAM NAME="autoSize" Value="false">\n');
    document.write('<PARAM NAME="Wmode" Value="transparent">\n');
    document.write('<PARAM NAME="displaySize" Value="True">\n');
    document.write('<PARAM NAME="enableContextMenu" Value="False">\n');
    document.write('<PARAM NAME="uiMode" Value="invisible">\n');
    document.write('</OBJECT>');
}

function goVideo(videoPath) 
{
    var objfrm = document.getElementById('frmVideo');
    var iqVideo = document.getElementById('iqVideo');
    

    iqVideo.value = videoPath;
        objfrm.submit();
    //frm.submit();
    //document.forms[0].submit();
}

function chgType(cID, pID) {
    var fObj = document.getElementById('Form1');
    var sObj = document.getElementById('deckboard');
    
    if (sObj.value == '') {
        alert('Please choose deck board type.');
    }
    else {
       //fObj.action = "productCatalog.aspx?catID=" + cID + "&prodID=" + pID;
       fObj.action = "";
        fObj.submit();
    }
}

