function ReloadParentWin()
{
	window.opener.window.location.reload();
}

function GotoParentWin(url)
{
	window.opener.window.navigate(url);
}

function preLoad()
{
	imagelist = new Array("images/menu_inside_over.gif",
						  "images/selection_left_arrow_over.jpg",
						  "images/selection_left_arrow_over_rs.jpg",
						  "images/selection_right_arrow_over.jpg",
						  "images/selection_right_arrow_over_ls.jpg");							
	i=0;
	while(i<imagelist.length)
	{
		img = new Image(); 
		img.src = imagelist[i];
		i++;
	}
}

function OpenPage(url,wndname,width,height,center,scrollbars,resize) 
{ 
	var left = 25; 
	var top = 25; 

	if(center == true) 
	{ 
		left = (screen.width - width)/2; 
		top = (screen.height - height)/2; 
	} 

	scrollbars = ( (scrollbars == undefined) || (scrollbars == false) ) ? 'no' : 'yes';
	resize = ( (resize == undefined) || (resize == false) ) ? 'no' : 'yes';

	var winStats='toolbar=no,location=no,directories=no,menubar=0,'; 
	winStats+='scrollbars='+scrollbars+',resizable='+resize+',width='+width+',height='+height; 
	if (navigator.appName.indexOf("Microsoft")>=0) 
	{ 
		winStats+=',left='+left+',top='+top; 
	} 
	else 
	{ 
		winStats+=',screenX='+left+',screenY='+top; 
	} 

	apopup=window.open(url,wndname,winStats);
	apopup.window.focus();
}		



function DroppdownChange()
{
	myForm = document.getElementById('productform');
	myForm.submit();
}

function pricelistMod()
{
	OpenPage('modify_pricelist.php','ModPriceList',520,100,true,false,false);	//ModPriceList ebbe a windowba submittol kesobb a Form

	myForm = document.getElementById('formPricelist');
	myForm.submit();
}

function buycheapMod()
{
	OpenPage('modify_buycheap.php','ModBuyCheap',520,100,true,false,false);

	myForm = document.getElementById('fromModBuycheap');
	myForm.submit();
}

function buycheapCancel()
{
	window.location = "admin.php?page=buycheap";
}

function buycheapClear()
{
	myText = document.getElementById('textBuycheap');
	myText.value = "";
}

function rowOver(rowid)
{
	overColor = '#DDDDDD'

	myRow = document.getElementById('row_'+rowid);
	myRow.style.backgroundColor = overColor;
}

function rowOut(rowid)
{
	outColor = '#EAEAEA';

	myRow = document.getElementById('row_'+rowid);
	myRow.style.backgroundColor = outColor;
}


function btnOver(btn)
{
	myBtn = document.getElementById(btn);
	myBtn.className='button_over';
}


function btnOut(btn)
{
	myBtn = document.getElementById(btn);
	myBtn.className='button';
}

function selectionRightOver()
{
	myArrowRight = document.getElementById('selectionRightArrow');
	myArrowLeft = document.getElementById('selectionLeftArrow');

	myArrowRight.src = 'images/selection_right_arrow_over.jpg';
	myArrowLeft.src = 'images/selection_right_arrow_over_ls.jpg';
}

function selectionRightOut()
{
	myArrowRight = document.getElementById('selectionRightArrow');
	myArrowLeft = document.getElementById('selectionLeftArrow');

	myArrowRight.src = 'images/selection_right_arrow.jpg';
	myArrowLeft.src = 'images/selection_left_arrow.jpg';
}

function selectionLeftOver()
{
	myArrowRight = document.getElementById('selectionRightArrow');
	myArrowLeft = document.getElementById('selectionLeftArrow');

	myArrowLeft.src = 'images/selection_left_arrow_over.jpg';
	myArrowRight.src = 'images/selection_left_arrow_over_rs.jpg';
}

function selectionLeftOut()
{
	myArrowRight = document.getElementById('selectionRightArrow');
	myArrowLeft = document.getElementById('selectionLeftArrow');

	myArrowLeft.src = 'images/selection_left_arrow.jpg';
	myArrowRight.src = 'images/selection_right_arrow.jpg';
}

function btnIngOver(id_btn)
{
	myBtn = document.getElementById('btn_'+id_btn);
	myBtn.className='ing_button_over';

	myHeading = document.getElementById('btntxt_'+id_btn);
	myHeading.className='ing_menu_over';
}


function btnIngOut(id_btn)
{
	myBtn = document.getElementById('btn_'+id_btn);
	myBtn.className='ing_button';

	myHeading = document.getElementById('btntxt_'+id_btn);
	myHeading.className='ing_menu';
}

