document.write('<style>#countrybox	{visibility: hidden;} #flagstoreselectbox	{visibility: hidden;}</style>');

function	init(menu)	{
	showMenu(menu)
}


function showPage(url) {
		document.location = url;
		}	


var visualPrefix = '/assets/www.phi-ton.com/countries/countries/';
var visualExtension = '.jpg';
		
function bgChange(visual) {
		visualLocation = visualPrefix+visual+visualExtension;
		document.countryVisual.src=visualLocation; 
		}	


function go(where)
{
	if (where == 1)			{location.href='./?page=spheres';}
	else if (where == 2)	{location.href='./?page=bed';}
	else if (where == 3)	{location.href='./?page=mattresses';}
}


function jumpto(x){
	if (document.form.jumpmenu.value != "null") {
		document.location.href = './?page=' + x
		}
}

function change(className)
{
    document.getElementById('bodypart').className = className;
}


function ShowHide(obj,to) {
	var objtoswap = document.getElementById(obj);
	if (to)	{
		if (to == 1)	{objtoswap.style.visibility="visible";}
		else	{objtoswap.style.visibility="hidden";}
		}
	else	{		
  		objtoswap.style.visibility= "hidden";
		}
}
		
function	showMenu(menu)	{
	ShowHide('about',0); ShowHide('bed',0); ShowHide('mattresses',0); ShowHide('cubeandsphere',0);
	ShowHide(menu,1)
}



function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=530,width=660,scrollbars=yes');
myform.target=windowname;
return true;
}

function Do(what)	{
	location.href='./?page='+what
	}
	
function updateImage (what)	{
	document.showImage.src=what;
}
   

	var win = null;
	function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes'
	win = window.open(mypage,myname,settings)
	}
	
	function addbookmark(){
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}
	
		//* setting Div to write PF description to *//
	
	function updatePFdesc(desc)	{	
		var popobj=document.all? document.all["portfolioTxt"] : document.getElementById? document.getElementById("portfolioTxt") : ""
		popobj.innerHTML= desc;
	 }		
	
function collapseMenu(layerid,layerswapid) {
	if(document.getElementById(layerid).style.visibility == "visible"){
	document.getElementById(layerid).style.visibility = "hidden";
	// document.getElementById(layerswapid).style.visibility = "visible";
	}
	else{
	document.getElementById(layerid).style.visibility = "visible";
	// document.getElementById(layerswapid).style.visibility = "hidden";
	}
}


function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

/* function to show detailed link & status info in statusbar */
	function stat(txt) {
	    window.status = txt;
	    } 
	
 
	
	// set title
	
	top.document.title = document.title;
	


	function showHide (id) 
		{ 
		var style = document.getElementById(id).style 
		if (style.visibility == "visible") 
		style.visibility = "hidden"; 
		else 
		style.visibility = "visible"; 
		} 

	function growSlink (id) 
		{ 
		var style = document.getElementById(id).style 
		if (style.height == "100%") 
		document.getElementById(id).style.height = "70px"; 
		else 
//		document.getElementById(id).style.height = "100%"; 
		document.getElementById(id).style.height = "460px"; 
		} 


	function checkNumber(val)	{
		if ((parseInt(val) != val) && (val != '')) {
		  alert(val + ' is no number')
		 }
		}

		function cent(amount) {
		// returns the amount in the .99 format 
		    amount -= 0;
		    amount = (Math.round(amount*100))/100;
		    return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
		}
		

var multiplayerWidth = 360;
var playerWidth = 360;
var playerHeight = 288;
 
function buildCustomPlayer(url,targetdiv,image,autostart,thisWidth,thisHeight)	{
	var playerObj = new SWFObject("http://www.phi-ton.com/video/flashplayer/flvplayer.swf","single",thisWidth,thisHeight,"7");
	playerObj.addParam("allowfullscreen","true");
	if (autostart) {playerObj.addVariable("autostart",autostart);}
	playerObj.addVariable("file",url);
	playerObj.addVariable("image",image);
	playerObj.addVariable("displaywidth",thisWidth);
	playerObj.addVariable("displayheight",thisHeight);
	playerObj.addVariable("backcolor","0xff2d2d");
	playerObj.addVariable("frontcolor","0xFFFFFF");
	playerObj.addVariable("lightcolor","0x000000");
	playerObj.write(targetdiv);
}
		