function changeScreenSize(w,h,left,top)
{
	window.resizeTo(w,h)
	window.moveTo(left, top)
}

function CreateBookmarkLink()
{
	var urlAddress = "http://www.kaykbayz.com";
	var pageName = "Kay.K.BayZ.com - Official Website";

	if(window.sidebar)
	{
		window.sidebar.addPanel(pageName, urlAddress,"");
	}
	else if(window.external)
	{
		window.external.AddFavorite(urlAddress,pageName)
	}
	else if(window.opera && window.print)
	{
		return true;
	}
	else
	{ 
		alert("Sorry! Your browser doesn't support this function.");
	}
}

function emptyEBox(obj)
{
	var val = obj.value;
	if(val == "email")
		obj.value='';
}

function pageLoader(value,category,page)
{
	if(category == "productType" && page == "add")
	{
		window.location = "addProduct.php?prodType="+value;
	}

	if(category == "value" && page == "add")
	{
		window.location = "addProduct.php?value="+value;
	}

	if(category == "productType" && page == "mod")
	{
		window.location = "modifyProduct.php?prodType="+value;
	}

	if(category == "value" && page == "mod")
	{
		window.location = "modifyProduct.php?value="+value;
	}
}

function goThere(address,email,type)
{
	if(type=='remFromBl')
		var result = window.confirm("Are you sure you want to remove "  + email + " from the blacklist?");

	if(type=='blacklist')
		var result = window.confirm("Are you sure you want to blacklist "  + email + "?");

	if(type=='site_status')
		var result = window.confirm("Are you sure you want to change the status of the site to: " + email + "?");

	if(result==true)
		window.location=address;
}

function toggleArea(brw,page)
{
	if(brw == 'MSIE')
	{
		if(page == "beverages")
		{
			document.getElementById('beverages').style.display = 'block';
			document.getElementById('foods').style.display = 'none'
		}

		if(page == "foods")
		{
			document.getElementById('beverages').style.display = 'none';
			document.getElementById('foods').style.display = 'block'
		}
	}
	else
	{
		if(page == "beverages")
		{
			document.getElementById('beverages').style.visibility = 'visible';
			document.getElementById('foods').style.visibility = 'collapse'
		}

		if(page == "foods")
		{
			document.getElementById('beverages').style.visibility = 'collapse';
			document.getElementById('foods').style.visibility = 'visible'
		}
	}
}

/*
Script made by Martial Boissonneault © 2001-2002 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
*/
timerID = null;
var active = 0;

function ChangePage(num){
    	if(document.getElementById){
    		obj[active].style.visibility = "hidden";
    		active = num;
    		obj[active].style.top = 0;
    		obj[active].style.visibility = "visible";
    	}
}
    
function ScrollUp(speed){
    	if(document.getElementById){
    		if(parseInt(obj[active].style.top) < 0){
    			obj[active].style.top = parseInt(obj[active].style.top) + speed + "px";
		}
    		timerID = setTimeout("ScrollUp("+speed+")",30);
    	}
}

function ScrollDown(speed){
    	if(document.getElementById){                        
    		if(parseInt(obj[active].style.top) > document.getElementById('cont').offsetHeight - obj[active].offsetHeight){ 
    			obj[active].style.top = parseInt(obj[active].style.top) - speed + "px";
		}
    		timerID = setTimeout("ScrollDown("+speed+")",30);
    	}
}

function ScrollStop(){
    	if(document.getElementById){
    		clearTimeout(timerID);
    	}
}

function ScrollPageInit() {
    	if(document.getElementById){
    		obj = document.getElementById("cont").getElementsByTagName("div");
    		obj['page1'].style.visibility = "visible";
    		obj['page1'].style.top = 0;	
    	}	
    	if(document.addEventListener){
    		for(i=0;i<document.getElementsByTagName('a').length;i++){
    			document.getElementsByTagName('a')[i].style.position = "relative";
		}
    	}
}
