var preloader=new Image();preloader.src="images/preloader.gif";

function view_img(id,alt){
var viewimg=window.open('view_img.php?id='+id+'&alt='+escape(alt),'','width=100,height=100,status=1');
}

function MakeImageArray(n)
{
	this.length=n;
	for (var i=0; i<=n; i++) { this[i] = new Image() }
	return this 
}

men_pic = new MakeImageArray(2);
men_pic[0].src = 'pics/icon_men.jpg';
men_pic[1].src = 'pics/icon_men_a.jpg';

women_pic = new MakeImageArray(2);
women_pic[0].src = 'pics/icon_women.jpg';
women_pic[1].src = 'pics/icon_women_a.jpg';

men_fw2005_pic = new MakeImageArray(2);
men_fw2005_pic[0].src = 'images/icon_men_fw2005.jpg';
men_fw2005_pic[1].src = 'images/icon_men_fw2005_a.jpg';

women_fw2005_pic = new MakeImageArray(2);
women_fw2005_pic[0].src = 'images/icon_women_fw2005.jpg';
women_fw2005_pic[1].src = 'images/icon_women_fw2005_a.jpg';

function showLogo(pic,num) {
	document.images['image_'+pic].src = eval(pic+'_pic')[num].src;
}

function createPictureWindow(Path,Width,Height,Title)
{
	var p = Math.ceil(Math.random()*10000);
	var q = Math.ceil(Math.random()*p);
	windowName = p+'X'+(Width*p)+(Height*q);
	WinFeatures = "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Height+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no";
	w = window.open("",windowName,WinFeatures);
	w.document.open();
	w.document.write('<head><title>LAWINE \ New Age Outwear</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>');
	w.document.write("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;'></body>"); 
	w.document.close();
}

function objectXY(obj) {
var dobj=eval('document.getElementById("'+obj+'")')
   var x = 0, y = 0;
do{
    x += dobj.offsetLeft;
    y += dobj.offsetTop;
  }while (typeof(dobj = dobj.offsetParent) != 'undefined' && dobj != null);
   return [x,y];
}

function win_resize(e,intWidth,intHeight){
  var newW=(intWidth==null || intWidth=='' || isNaN(parseInt(intWidth)))? 600 : parseInt(intWidth);
  var newH=(intHeight==null || intHeight=='' || isNaN(parseInt(intHeight)))? 600 : parseInt(intHeight);
  if(is_ie4 || is_ie){newW+=10;newH+=29;}
  if(is_ns4 || is_ns){newW+=6;newH+=27;}
  if(is_opera){newW+=10;newH+=29;}
  if(is_firefox){newW+=0;newH+=22;}
	if(screen.width>newW)newLeft=Math.round((screen.width-newW)/2);
	 else newLeft=10;
	if(screen.height>newH)newTop=Math.round((screen.height-newH)/2);
	 else newTop=10;
  newH+=20;
  e.resizeTo(newW,newH);
  e.moveTo(newLeft,newTop);
}

function move_window_to_center_screen(){
if(is_ns4 || is_ns){
leftco=document.body.offsetWidth+16;
topco=document.body.offsetHeight+44;
}
if(is_ie || is_ie4 || is_firefox){
leftco=document.body.clientWidth;
topco=document.body.clientHeight;
}
if(is_opera){
leftco=document.body.clientWidth;
topco=document.body.clientHeight+200;
}
newLeft=Math.round((screen.width-leftco)/2);
newTop=Math.round((screen.height-topco)/2);

window.moveTo(newLeft,newTop);
}

var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_firefox  = (userAgent.indexOf('firefox') != -1);
var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf('msie 4.') != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));
var is_mac    = (userAgent.indexOf('mac') != -1);
