//	fWriteFlashObject(nID, sUrl, nWidth, nHeight, sBG, bTransparent, sCssClass)

function fWriteFlashObject(sID, sUrl, nWidth, nHeight, sBG, bTransparent, sCssClass){
	sSSL=(location.href.indexOf("https")>=0 ? "s" : "")

	document.write('<object id="'+ sID +'" width="'+ nWidth +'" height="'+ nHeight +'" class="'+ sCssClass +'" codebase="http'+ sSSL +'://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">')
	document.write('<param name="movie" value="'+ sUrl +'">')
	if(bTransparent) document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="'+ sBG +'" />');
	document.write('<param name="quality" value="high">');
	document.write('<embed id="'+ sID +'" src="'+ sUrl +'" width="'+ nWidth +'" height="'+ nHeight +'" class="'+ sCssClass +'" bgcolor="'+ sBG +'" '+ (bTransparent ? 'wmode="transparent"' : '') +' quality="high"  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http'+ sSSL +'://www.macromedia.com/go/getflashplayer"></embed>')
	document.write('</object>');
}

function fGetFlashObject(sID, sUrl, nWidth, nHeight, sBG, bTransparent, sCssClass){
	var str=""
	str+='<object id="'+ sID +'" width="'+ nWidth +'" height="'+ nHeight +'" class="'+ sCssClass +'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">'
	str+='<param name="movie" value="'+ sUrl +'">'
	if(bTransparent) str+='<param name="wmode" value="transparent" />'
	str+='<param name="bgcolor" value="'+ sBG +'" />'
	str+='<param name="quality" value="high">'
	str+='<embed id="'+ sID +'" src="'+ sUrl +'" width="'+ nWidth +'" height="'+ nHeight +'" class="'+ sCssClass +'" bgcolor="'+ sBG +'" '+ (bTransparent ? 'wmode="transparent"' : '') +' quality="high"  TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></embed>'
	str+='</object>'

	return str;
}

function OpenMenu(URL, newwin){
	if(newwin)
		window.open("/"+ URL)
	else
		location.href="/"+ URL
}

function fPlaceLogos(){
	try{
		nWindowWidth=(document.body.offsetWidth ? document.body.offsetWidth : document.width);

		if(nWindowWidth>=1024)
			document.getElementById("oLogos").style.paddingLeft=((nWindowWidth-1024)/2)+5;
		else
			document.getElementById("oLogos").style.paddingLeft="5px";
	}catch(e){}
}

function ViewPromo(URL){
		location.href=URL
}

function fChangepage(pageid){
	var sPageURL;
	switch(pageid){
		case 1: sPageURL="/cameras.asp"; break;
		case 2: sPageURL="/virtualTour.asp"; break;
		case 3: sPageURL="/today.asp"; break;
		default: sPageURL=null; break;
	}

	if(sPageURL) top.location.href=sPageURL;
}

function PopUp(id, width, height){
	//window.open("/popup.asp?id="+id,null,"width="+(width||530)+", height="+(height||300)+", scrollbars=yes, resizable=yes")
	location.href="/content.asp?back=1&id="+id
}

function OpenImage(img){
	window.open("/ImgPopUp.asp?img="+img,null,"width=5,height=5")
}

function fPrintPage(){
	window.open('/print.html', 'winPrint', 'width=700, height=400, scrollbars=yes');
}



var oScrollThumbsTimer;
function fScrollThumbs(bMove, nDirection){
	if(bMove)
		oScrollThumbsTimer=setInterval("fDoScroll("+ nDirection +")", 40)
	else
		clearInterval(oScrollThumbsTimer);
}

function fDoScroll(nDirection){
	var obj=document.getElementById("oThumbs");
	obj.scrollTop=(nDirection==1 ? obj.scrollTop+5 : obj.scrollTop-5);
}


var oScrollThumbsTimerH;
function fScrollThumbsH(bMove, nDirection){
	if(bMove)
		oScrollThumbsTimerH=setInterval("fDoScrollH("+ nDirection +")", 40)
	else
		clearInterval(oScrollThumbsTimerH);
}

function fDoScrollH(nDirection){
	var obj=document.getElementById("oThumbs");
	obj.scrollLeft=(nDirection==1 ? obj.scrollLeft+5 : obj.scrollLeft-5);
}

var nLastSelectedID=0;
function fChangeMovie(nMovieID, sTitle, sURL){
	if(!sURL){
		switch(nMovieID) {
			case 1:
				sURL="http://switch5.castup.net/Customers/kotel/400x300_live/design.asp?clipurl=http%3A//switch3.castup.net/cunet/gm.asp%3Fai%3D215%26ar%3Dkotel_camera_2"
				break;
			case 2:
				sURL="http://switch5.castup.net/Customers/kotel/400x300_live/design.asp?clipurl=http%3A//switch3.castup.net/cunet/gm.asp%3Fai%3D215%26ar%3Dkotel_camera_1"
				break;
			case 3:
				sURL="http://switch5.castup.net/Customers/kotel/400x300_live/design.asp?clipurl=http%3A//switch3.castup.net/cunet/gm.asp%3Fai%3D215%26ar%3Dkotel_camera_3"
				break;
		}
		document.getElementById("oMoviePlayer").innerHTML="<iframe src=\""+ sURL +"\" frameborder=\"0\" Scrolling=\"no\"></iframe>";
		//document.getElementById("oMovieTitle").innerHTML=sTitle;
		return
	}
	if(nLastSelectedID) document.getElementById("oMovieListItem"+ nLastSelectedID).className="clsMovieBoxItem";
	document.getElementById("oMovieListItem"+ nMovieID).className="clsMovieBoxItemSelected";
	document.getElementById("oMovieTitle").innerHTML=sTitle;
	document.getElementById("oMoviePlayer").innerHTML="<iframe src=\""+ sURL +"\" frameborder=\"0\" scrolling=\"no\"></iframe>";
	nLastSelectedID=nMovieID;
}



