function WindowUp()
{
	if(parent!=null)
		parent.scrollTo(0,0);
	else
		window.scrollTo(0,0);
}
function OpenHome()
{
	WindowUp();
	win=window.open("../shop/MainCategories.aspx","ResultWin");
}

function OpenBasket()
{
	WindowUp();
	win=window.open("../shop/mybasket.aspx","ResultWin");
}
function	OpenAbout()
{
	WindowUp();
	win=window.open("../shop/about.htm","ResultWin");
}
function	OpenContacts()
{
	WindowUp();
	win=window.open("../shop/Contact.htm","ResultWin");
}
function OpenOffersWin()
{
	WindowUp();
	win=window.open("../shop/SpecialOffers.aspx","ResultWin");
}
function ItemPropWin(ItemID)
{
	//win=window.showModalDialog("ProductProp.aspx?ItemID="+ItemID,"Product","dialogHeight:405px;dialogLeft:200px;dialogTop:200px;dialogWidth:800px;edge:raised;resizable:no;scroll:no;status:no")
	win=window.open("ProductProp.aspx?ItemID="+ItemID,"","status=yes,menubar=no,toolbar=no,directories=no,menubar=no,scrollbars=no,top=100,left=200,width=750,height=580");
	
}

function ViewLargePic(PicPath)
{
	win=window.open("ProductLargePic.aspx?PicPath="+PicPath,"EnlargePic","status=yes,menubar=no,toolbar=no,directories=no,menubar=no,scrollbars=no,top=100,left="+screen.width*0.4+",width=600,height=600");
	win.focus();
}

function OpenLightersWin()
{
	win=window.open("http://www.lighterscases.com","Lighters","status=yes,menubar=yes,toolbar=yes,directories=yes,menubar=yes,scrollbars=yes,top=0,left=0,width="+screen.width*0.99+",height="+screen.height*0.97);
	win.focus();
}

function SetPicSizePic(picobj,keyCode)
       {
          if(keyCode==45)
	           {
	               reduceImg(picobj, 50, 50, 100, 100) 
	             }
	          else
	                if(keyCode==43)
	                   enlargeImg(picobj, 50, 50, 600, 600)     
	                 
       }
       
       function enlargeImg(imgobj, dx, dy, maxx, maxy) 
{

currentx = imgobj.width;
currenty = imgobj.height;

if ((currentx<maxx-dx) && (currenty<maxy-dy)) 
{
    imgobj.height = currenty + dy;
    imgobj.width = currentx + dx;
}
}
function reduceImg(imgobj, dx, dy, minx, miny) 
{

currentx = imgobj.width;
currenty = imgobj.height;
if ((currentx>minx+dx) && (currenty>miny+dy)) 
{
    imgobj.height = currenty - dy;
    imgobj.width = currentx - dx;
}
}
function InitPicSize(imgobj)
{
    imgobj.height = 300;
    imgobj.width =300;
}




