﻿	var wth;
	var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

		var pos=0;
		var speed=5;
		var timer=null;
		var entrain=6;
		var pz=0, tt='';var object;
		//alert(pos+'---0---=====');
		function scroll1(dir,id,boost,entrain1,idtx){
			if(timer!=null) stop();
			//alert(entrain1+"--");
			pos=document.getElementById(id).scrollLeft;
			if(entrain1=='a'){
				object=document.getElementById(id);
				timer=window.setInterval("sc("+dir+","+boost+");",40);
			}else{
				
				entrain=20;
				pz=0;
				sk=0;
				//alert(document.getElementById(id).scrollLeft+'**');
				if(document.getElementById(id).scrollLeft==0) dir=1;
				else dir=-1;
				//alert(pos+'---1---=====');
				//if(idtx!=tt){
					
					timer=window.setInterval("entrainSc("+dir+",'"+id+"',"+boost+");",20);
					//tt=idtx;
				//}
				//alert(pos+'---2---=====');
			}
		}

		function sc(dir,boost){
			
			if((pos+dir)>=0 && (pos+dir)<=(object.scrollWidth-object.offsetWidth)){
				pos+=dir*speed*boost;			
				object.scrollLeft=pos;				
			}
			else{
				if(dir==1) pos=0;
				else pos=object.scrollWidth-object.offsetWidth;
				object.scrollLeft=pos;
			}
		}
		
		function entrainSc(dir,id,boost){
				entrain=entrain/1.19;
				if(document.getElementById(id).scrollLeft>=508){stop();document.getElementById(id).scrollLeft=507;return;}
				pos=document.getElementById(id).scrollLeft+(dir*speed*boost*entrain);
				if(pos>=0 && pos<=(document.getElementById(id).scrollWidth-document.getElementById(id).offsetWidth)){
					document.getElementById(id).scrollLeft=pos;
				}else{
					stop();
					if(dir==-1)document.getElementById(id).scrollLeft=0;
					else document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth-document.getElementById(id).offsetWidth;
				}
				//document.getElementById('debug').innerHTML+=document.getElementById(id).scrollLeft+" -- "+entrain+" - "+(pos>=0 && pos<=(document.getElementById(id).scrollWidth-document.getElementById(id).offsetWidth))+"<br>";
		}
		
		
		
		function stop(){
			//document.getElementById('debug').innerHTML+="---- STOP ---<br>";
			window.clearInterval(timer);
			timer=null;
		}

function changeColor(id,className){
	document.getElementById(id).className=className;
}
function doSomething(e) {
			var posx = 0;
			var posy = 0;
			if (!e) var e = window.event;
			if (e.pageX || e.pageY) 	{
				posx = e.pageX;
				posy = e.pageY;
			}
			else if (e.clientX || e.clientY) 	{
				posx = e.clientX + document.body.scrollLeft
					+ document.documentElement.scrollLeft;
				posy = e.clientY + document.body.scrollTop
					+ document.documentElement.scrollTop;
			}
			// posx and posy contain the mouse position relative to the document
			// Do something with this information
			
			return [posx,posy];
			//alert(myPos[0]+'--'+myPos[2]);
			
}
function setheightDv(){
    var tm=alertmyHeight()-164-134;
	//alert(tm+'--');
	if(tm<815) tm=815;
	document.getElementById('idDv').style.height=tm+"px";
	//var wth=alertSize();
	
	if(wth<996)document.getElementById('divChilld').style.width=996+"px";
	//alert(wth+'--'+document.getElementById('divChilld').style.width);
}
function setheightDv1(){
    var tm=alertmyHeight()-164-134;
	//alert(tm+'--');
	//if(tm<815) tm=815;
	document.getElementById('idDv').style.height=tm+"px";
	//var wth=alertSize();
	
	if(wth<996)document.getElementById('divChilld').style.width=996+"px";
	//alert(wth+'--'+document.getElementById('divChilld').style.width);
}
function setPos(id,idshow,left,top){
	
	var lfRed=document.getElementById(id).offsetLeft;
	var tpRed=document.getElementById(id).offsetTop;
	
	//alert(left+'-------'+top);
	document.getElementById(idshow).style.left=lfRed+left+document.getElementById('idtable').offsetLeft+"px";
	document.getElementById(idshow).style.top=tpRed+top+"px";
	//alert(document.getElementById('isSend').style.left);
	//alert(lfRed+'---'+tpRed);
	
	//alert(document.getElementById('idtable').offsetLeft+'======');
}
function setWidth(id,width){
	document.getElementById(id).style.width=width+'px';
	//alert(document.getElementById(id).offsetWidth+'---');
}
function setHeight(id,height){
	document.getElementById(id).style.height=height+'px';
	//alert(document.getElementById(id).offsetWidth+'---');
}
function setPosition(id,idshow,left,top){
	var lfRed=document.getElementById(id).offsetLeft;
	var tpRed=document.getElementById(id).offsetTop;
	//alert(idshow+'--');
	if(document.getElementById(idshow))document.getElementById(idshow).style.left=lfRed+left+document.getElementById('tdmiddle').offsetWidth+"px";
	if(document.getElementById(idshow))document.getElementById(idshow).style.top=tpRed+top+"px";
	//alert(document.getElementById(idshow).style.left+'--'+document.getElementById(idshow).style.top+"---");
}
function setPosition1(id,idshow,left,top){
	//var lfRed=document.getElementById(id).offsetLeft;
	var tpRed=document.getElementById(id).offsetTop;
	//alert(document.getElementById('tdmiddle').offsetWidth+'fffffff'+'---L'+lfRed+'---t'+tpRed);
	if(document.getElementById(idshow))document.getElementById(idshow).style.left=left+((wth-996)/2)+"px";
	if(document.getElementById(idshow))document.getElementById(idshow).style.top=tpRed+top+"px";
	//alert(lfRed+'--'+tpRed);
}
function setHeightTbl(id,idshow,ht,left){
	var tp=document.getElementById(id).offsetHeight;
	//alert(tp+'=='+ht+'------');
	document.getElementById(idshow).style.top=tp-ht+"px";
	var lfRed=document.getElementById(id).offsetLeft;
	var tmp=lfRed+left+((wth-996)/2);
	if((tmp+document.getElementById(idshow).offsetWidth)>wth){
		tmp=wth-document.getElementById(idshow).offsetWidth;
	}
	document.getElementById(idshow).style.left=tmp+"px";
}
var scroll=0;
function fscroll(ta_id,sc){
	//alert(ta_id+'----');
	var hg=document.getElementById(ta_id).scrollHeight;
	//window.alert(document.getElementById(ta_id).scrollHeight+" - "+scroll+" - "+document.getElementById(ta_id).scrollTop);
	//document.getElementById(ta_id).scrollTop=document.getElementById(ta_id).scrollHeight;
	if((scroll<=hg) && (scroll>=0)){
		scroll+=sc;
		document.getElementById(ta_id).scrollTop=scroll;
	}
	if(scroll>hg){scroll=hg;}
	if(scroll<0){scroll=0;}
	
	
}
function changeBallon(id,className,idpos,left,top,txt){
	document.getElementById(id).className=className;
	
	//alert(idpos+'------'+id);
	setPosition(idpos,id,left,top);
	document.getElementById(id).innerHTML=txt;
}
function setTextClass(id,className,txt){
	document.getElementById(id).className=className;
/* 	if(id=='idwoman'){
		document.getElementById(id).innerHTML='<a class="logolink" href="">'+txt+'</a>';
	}else if(id=='idgirl'){
		document.getElementById(id).innerHTML='<a class="logolink" href="">'+txt+'</a>';
	}else if(id=='idwoman2'){
		document.getElementById(id).innerHTML='<a class="logolink2" href="">'+txt+'</a>';
	}else if(id=='idgirl2'){
		document.getElementById(id).innerHTML='<a class="logolink2" href="">'+txt+'</a>';
	}
	else{
		document.getElementById(id).innerHTML=txt;
	} */
}
function setText(id,txt){
	document.getElementById(id).innerHTML=txt;
}
function changeBallon1(id,classname1,x,y,txt,pl,pt){
	document.getElementById(id).className=classname1;
	//alert(x+'--'+y);
	document.getElementById(id).style.left=x-pl+"px";
	document.getElementById(id).style.top=y-pt+"px";
	document.getElementById(id).innerHTML=txt.replace('_',' ');
}
function changeTexture(id,className,idpos,left,top){
	document.getElementById(id).className=className;
	
	//alert(idpos+'------'+id);
	setPosition(idpos,id,left,top);
	
}
function checkFields(inputName,inputEmail,idastextarea){
	//alert(inputName+'---*');
	document.getElementById('cntnt01fbrp_submit').className='sendAct';
	var pz=0;
	if((document.getElementById(inputName).value=='')||(document.getElementById(inputName).value=='Jūsų vardas')){
	
		pz=1;
		//document.getElementById('idyourname').className='redclYourname';
		
		document.getElementById(inputName).parentNode.className='redclYourname';
		changeColor('idarrow1','arrow');
		setPosition(idastextarea,'idarrow1',230,60);
		//alert(document.getElementById('idTextarea').style.left+'---...'+document.getElementById('idarrow1').style.left+'--------------dd');
		//alert('aaaa');
		
	//call ,document.formname
		//formname.submit();
		//alert('a----');
	}else{
		document.getElementById(inputName).parentNode.className='input1';
		changeColor('idarrow1','hide');
	}
	if((document.getElementById(inputEmail).value=='')||(document.getElementById(inputEmail).value=='El. paštas')){
	
		pz=1;
		//document.getElementById('clEmail').className='redclEmail';
		
		document.getElementById('inputEmail_1').parentNode.className='redclEmail';
		changeColor('idarrow2','arrow');
		//alert(document.getElementById('idyourname').style.left+'---...');
		setPosition(idastextarea,'idarrow2',230,140);
		
	}else{
		document.getElementById('inputEmail_1').parentNode.className='input2';
		changeColor('idarrow2','hide');
	}
	
	if((document.getElementById(idastextarea).value=='')||(document.getElementById(idastextarea).value=='Jūsų tekstas')){
	
		pz=1;
		//document.getElementById('idTextarea').className='redmassg';
		document.getElementById(idastextarea).parentNode.className='redmassg';
		changeColor('idarrow3','arrow');
		setPosition(idastextarea,'idarrow3',230,220);
		
	}else{
		document.getElementById(idastextarea).parentNode.className='textarea1';
		changeColor('idarrow3','hide');
	}
	
	if(pz==0){

		document.getElementById('idUpDown').style.visibility = 'hidden';

		return true;
        //document.getElementById("cntnt01moduleform_1").submit();	
//alert('---+////');		//verify2Email(document.getElementById(inputName).value,document.getElementById(inputEmail).value,document.getElementById(idastextarea).value);
	}else{
	
		//alert('Uzpildykite laukus!!');
		
		//document.getElementById('successfully').className='successfull';
		//document.getElementById('execute').className='imgOpicity';
			
		return false;	
	}
	
	changeColor('isSend','sendAct');
}
function verify2Email(yourname,email,txt) {
	//checkEmail = form.email.value
	var pz=0;
	
	if ((email.indexOf('@') < 0) || ((email.charAt(email.length-4) != '.') && (email.charAt(email.length-3) != '.')))
	{
		
		document.getElementById('div_second').className='inputGreen';
		
		pz=1;
		
	}
	
	if(pz==0) {
		ajaxFunction(yourname,email,txt);
		
	}else{
		//alert("Elektroninio pasto adresas ivestas neteisingai!!!");
		document.getElementById('successfully').className='successfull';
		document.getElementById('execute').className='imgOpicity';
	}

}






function ajaxFunction(idyourname,clEmail,idTextarea)
{
	var xmlhttp;
	if (window.XMLHttpRequest)
	{
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else
	{
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			//document.myForm.time.value=xmlhttp.responseText;
		//	alert(xmlhttp.responseText+'-email------');
			//window.location.reload();
			window.location.href=window.location.href
		}
	}
	xmlhttp.open("GET","data.php?idyourname="+idyourname+"&clEmail="+clEmail+"&idTextarea="+idTextarea+"",true);
	xmlhttp.send(null);
}
function displayObj(id,visibility){
	if(document.getElementById(id))document.getElementById(id).style.display = visibility;
}

function alertSize() {
  var myWidth = 0;//, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    //myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth ) ) {//|| document.documentElement.clientHeight 
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    //myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth) ) {// || document.body.clientHeight 
    //IE 4 compatible
    myWidth = document.body.clientWidth;
   // myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  //alert(document.getElementById('tdmiddle').offsetWidth+'-jjjj---'+document.getElementById('idtd').offsetWidth);
  
  return myWidth-getScrollerWidth();
}
function alertmyHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
  //  myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {//|| document.documentElement.clientHeight 
    //IE 6+ in 'standards compliant mode'
    //myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientHeight) ) {// || document.body.clientHeight 
    //IE 4 compatible
    //myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  //alert(document.getElementById('tdmiddle').offsetWidth+'-jjjj---'+document.getElementById('idtd').offsetWidth);
  
  return myHeight;
}
 function getScrollerWidth() {

          var scr = null;

          var inn = null;

          var wNoScroll = 0;

          var wScroll = 0;

          // Outer scrolling div

          scr = document.createElement('div');

          scr.style.position = 'absolute';

          scr.style.top = '-1000px';

          scr.style.left = '-1000px';
 
          scr.style.width = '100px';

          scr.style.height = '50px';

          // Start with no scrollbar

          scr.style.overflow = 'hidden';

          // Inner content div

          inn = document.createElement('div');

          inn.style.width = '100%';

          inn.style.height = '200px';

          // Put the inner div in the scrolling div

          scr.appendChild(inn);

          // Append the scrolling div to the doc

          document.body.appendChild(scr);

          // Width of the inner div sans scrollbar

          wNoScroll = inn.offsetWidth;

          // Add the scrollbar

          scr.style.overflow = 'auto';

          // Width of the inner div width scrollbar

          wScroll = inn.offsetWidth;

          // Remove the scrolling div from the doc

          document.body.removeChild(

     document.body.lastChild);

          // Pixel width of the scroller
     return (wNoScroll - wScroll);
}
var opp=1;var dvID=null;var timerBall=null;var pzz=1;
function changeBallOpacity(id){
//var g=obj.getAttributeNode("id");
 //var n = g.value;


	 if(timerBall==null){// && pzz){
	 pzz=0;
	 dvID=id;
	 opp=1;

	 timerBall=window.setInterval("scBallOpacity();",60);

	//alert('b');

	 }

}

function scBallOpacity(){
/* alert('--ii-');

 alert(document.getElementById(dv)+'.***..'); */
 //alert(dv+'--a');

 // alert(document.getElementById(dv)+'...');
 opp=opp-0.3;
 if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5){
	 if(opp>0.1){
	 document.getElementById(dvID).style.MozOpacity=opp;

	 }else{
	 window.clearInterval(timerBall);
	 timerBall=null;
	 dvID=null;

	 }
 }else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4){//alert('aa');
	 if(opp>0.1){
	 //document.getElementById(dv).filters.alpha.opacity=op;
	 document.getElementById(dvID).style.filter="alpha(opacity="+(opp*100)+")";
	 //alert(document.getElementById(dv).style.filter+'--');

	 //document.getElementById('debug').innerHTML+=op+'---';
	 }else{
	 window.clearInterval(timerBall);
	 timerBall=null;
	 dvID=null;

	 }
 }




} 
var globalBallNr=-1;var objBallGlobal=null;
function setBallOpacity(obj,id){

	var getId=id.split("_");


	if(globalBallNr!=getId[1])
	{

		//if(pzz){

			 if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5){
				obj.style.MozOpacity=1;
				if(objBallGlobal)objBallGlobal.style.MozOpacity=1;
			 }else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4){
				obj.style.filter="alpha(opacity=100)";
				if(objBallGlobal)objBallGlobal.style.filter="alpha(opacity=100)";
			 }
		// }
		
		 changeBallOpacity(id);
		 objBallGlobal=obj;
		 globalBallNr=getId[1];
		
	}
	

} 
var globalidtexture=null;
function texture(img,idtexture,txt,price,data){
	if(idtexture==globalidtexture) return;
	globalidtexture=idtexture;
	setBallOpacity(document.getElementById(idtexture),idtexture);
	var ps=1;
	if(document.getElementById('idtrousers').scrollLeft==0) ps=2;
	document.getElementById('idtrousersIn'+ps).style.backgroundImage='url('+img+')';
	scroll1(1,'idtrousers',1,'b',idtexture);
	//setText('idtname',txt.replace('_',' '));
	price=price.replace('_',' ');
	setText('idprice',price);
	//uploads/images/Gallery/trousers/Teksturos/1.jpg
	//alert(img+'--');
	var img1=img.split("/");
	img1=img1[6].split(".");
	
	document.getElementById('showTrousers').rel="lightbox[gallery_"+idtexture.replace('idtexture','')+"]";
	
	document.getElementById('showTrousers').href=img.replace("Teksturos",img1[0]).replace(img1[0]+'.jpg',"1.jpg");
	
	document.getElementById('showTrousers1').rel="lightbox[gallery_a"+idtexture.replace('idtexture','')+"]";
	
	document.getElementById('showTrousers1').href=img.replace("Teksturos",img1[0]).replace(img1[0]+'.jpg',"1.jpg");
/* 	document.getElementById('xxl').className="fr clw";
	document.getElementById('xl').className="fr clw";
	document.getElementById('l').className="fr clw";
	document.getElementById('m').className="fr clw";
	document.getElementById('s').className="fr clw"; */
	data=data.replace('.jpg','').split("__");
	document.getElementById('xxl').innerHTML=data[3];
	/* for(var i=3;i<data.length;i++)
		document.getElementById(data[i].toLowerCase()).className="fr cyl"; */
	//changeOpacity('show2');
	
}


function onPageLoad(){

	setheightDv1();
	setTdWidth();
	setPosition('idtable','idHeader',60,100);
	setPosition('idtable','idCatalog',590,0);
	setPosition('idtable','where2get',596,45);
	setPosition('idtable','idcontacts',770,101);
	setPosition('idtable','idevents',942,90);
	var browser=navigator.appName;
	if(document.getElementById('message')){
		document.getElementById('idUpDown').style.visibility = 'visible';
	}else{
		document.getElementById('idUpDown').style.visibility = 'hidden';
	}
	setPosition('idpz','idUpDown',270,515);
	if(browser=="Microsoft Internet Explorer"){
		setPosition('idpz','idUpDown',270,525);
	}
	if(document.getElementById('cntnt01fbrp_submit')){
		setPosition('idpz','cntnt01fbrp_submit',35,490);
		if(browser=="Microsoft Internet Explorer"){
			setPosition('idpz','cntnt01fbrp_submit',35,520);
		}
	}

	if(document.getElementById('message')){
		
		
		document.getElementById('message').parentNode.style.top=300+'px';
		if(browser=="Microsoft Internet Explorer"){
			document.getElementById('message').parentNode.style.top=310+'px';
		}
		document.getElementById('message').onfocus=function(){
			if (document.getElementById('message').value=='Jūsų tekstas')document.getElementById('message').value='';
			return false;
		};
		document.getElementById('message').onblur=function(){
			if (document.getElementById('message').value=='') document.getElementById('message').value='Jūsų tekstas';return false;
		}
	}
	

}	
function reloadPageIndex(){
	//document.getElementById("debug").innerHTML+="* ";//alert(BrowserDetect.browser+'--'+BrowserDetect.version);
	if(BrowserDetect.browser=='Explorer'){//&&(BrowserDetect.version==6))
		pageOnloadIndex();
	}else{
	
		window.location.href=window.location.href;
	}
}
function reloadPageGallery(){
//document.getElementById("debug").innerHTML+="* ";
	//window.location.href=window.location.href;
	onLoadGallery();
}
function pageOnloadIndex(){
	changeBgPos('logo',0,0);
	setPosition('idtable','idCatalog',590,0);
	setPosition('idtable','where2get',596,45);
	setPosition('idtable','idcontacts',770,101);
	setPosition('idtable','idevents',942,90);
	setPosition('idtable','logo',-4,0);
	var browser=navigator.appName;
	if(BrowserDetect.browser=="Explorer"&&BrowserDetect.version=="6"){
		setPosition('idtable','logo',-5,0);
	}
	setPosition('idtable','idman',80,190);
	if(document.getElementById('imgtd')){
	
		if(document.getElementById('idshares')){
		//alert(document.getElementById('imgtd').offsetWidth+'**');
			document.getElementById("idshares").style.marginLeft =document.getElementById('imgtd').offsetWidth+"px";
			//alert(document.getElementById("idshares").style.marginLeft+'--///-');
		}
	} 
	setTdWidth();
	document.getElementById('desp').className='hide1';
	
	
}	
function setTdWidth(){
	if(document.getElementById("corn").offsetWidth<52)document.getElementById("corn").style.width=52+"px";

}
function onLoadEvents(){
	setPosition('idtable','idHeader',60,100);
	setPosition('idtable','idwhirl',230,100);
	displayObj('idwhirl','block');
	
	displayObj('idHeader','block');
	
	setPosition('idtable','idCatalog',590,0);
	setPosition('idtable','where2get',596,45);
	setPosition('idtable','idcontacts',770,101);
	setPosition('idtable','idevents',942,90);
	displayObj('idcontacts','block');
	
	displayObj('idevents','block');
	setheightDv1();

}
function reloadPageEvents(){
	//document.getElementById("debug").innerHTML+="* ";//alert(BrowserDetect.browser+'--'+BrowserDetect.version);
	if((BrowserDetect.browser=='Explorer')&&(BrowserDetect.version==6)){
		onLoadEvents();
	}else{
	
		window.location.href=window.location.href;
	}
}

function reloadPageCatalog(){
	//document.getElementById("debug").innerHTML+="* ";//alert(BrowserDetect.browser+'--'+BrowserDetect.version);
	if((BrowserDetect.browser=='Explorer')&&(BrowserDetect.version==6)){
		//onLoadCatalog();
	}else{
	
		window.location.href=window.location.href;
	}
}
function reloadPageContacts(){
	//document.getElementById("debug").innerHTML+="* ";//alert(BrowserDetect.browser+'--'+BrowserDetect.version);
	if((BrowserDetect.browser=='Explorer')&&(BrowserDetect.version==6)){
		onPageLoad();
	}else{
	
		window.location.href=window.location.href;
	}
}
function onLoadCatalog(){
	setPosition('idtable','idHeader',60,100);
	setPosition('idtable','idCatalog',590,0);
	setPosition('idtable','where2get',596,45);
	setPosition('idtable','idcontacts',770,101);
	setPosition('idtable','idevents',942,90);
	setheightDv1();

}
var globalFolder=-1;
function onLoadGallery(){
	/* setPosition('idtable','idHeader',60,100);
	setPosition('idtable','idCatalog',590,0);
	setPosition('idtable','where2get',596,45);
	setPosition('idtable','idcontacts',770,101);
	setPosition('idtable','idevents',942,90);
	 */
	 wth=alertSize();
	 setheightDv();
	
	

	document.getElementById('idtrousersIn2').style.left=400+'px';
	var makesrollDiv=((wth-996)/2)-130;
	if(makesrollDiv<0)makesrollDiv=0;
	document.getElementById('makeMeScrollable').style.left=makesrollDiv+'px';
	document.getElementById('idbar').style.left=((wth-996)/2)-130+'px';
	if(wth<996)document.getElementById('idwrap').style.width="1006px";
	else document.getElementById('idwrap').style.width=wth+10+"px";
//	alert(wth+"--"+document.getElementById('idwrap').style.width);
	setPosition1('idtable','idsquare',292,100);
	setPosition1('idtable','idmagnifier1',592,120);
	
	setPosition1('idtable','scrollleft0',-134,490);//
	var hgt=alertmyHeight();
	document.getElementById('scrollleft0').style.height=hgt-document.getElementById('scrollleft0').offsetTop+'px';
	//document.getElementById('scrollleft2').style.height=hgt-document.getElementById('scrollleft2').offsetTop+'px';
	
	setPosition1('idtable','scrollleft1',121,390);
	setPosition1('idtable','scrollleft6',151,380);
	setHeightTbl('idtable','idContactsFull',134,850);
	setPosition1('idtable','scrollleft3',249,320);
	setPosition1('idtable','scrollleft7',183,350);
	setPosition1('idtable','scrollleft2',-7,440);//
	
	setPosition1('idtable','scrollleft4',59,420);
	setPosition1('idtable','scrollleft5',89,420);
	
	/* setPosition1('idtable','scrollRight1',wth-226,0);
	setPosition1('idtable','scrollRight2',wth-352,0);
	setPosition1('idtable','scrollRight3',wth-472,0);
	setPosition1('idtable','scrollRight4',wth-592,0); */
	
	document.getElementById('scrollRight1').style.left=(((wth-996)/2)+1002)+"px";
	document.getElementById('scrollRight2').style.left=(((wth-996)/2)+872)+"px";
	document.getElementById('scrollRight3').style.left=(((wth-996)/2)+762)+"px";
	document.getElementById('scrollRight5').style.left=(((wth-996)/2)+822)+"px";
	document.getElementById('scrollRight4').style.left=(((wth-996)/2)+636)+"px";
	document.getElementById('scrollRight4').style.top=120+"px";
	
	document.getElementById('scrollRight3').style.top=70+"px";
	document.getElementById('scrollRight5').style.top=40+"px";
	//var charVar=window.location+"";
	globalFolder=0;//charVar.charAt(charVar.length-1);
	settextureFolder(0);
	
	setmenu('one-ddheader',document.getElementById('menuid_0').innerHTML);
	setPosition1('idtable','idzoom1',346,680);
	setPosition1('idtable','idtrousers',430,390);
	setPosition1('idtable','idmenubar',70,180);
	setPosition1('idtable','chooseColection',70,160);
	setPosition1('idtable','idprice',516,690);
	document.getElementById('desp').className='hide1';
	
	var tm=alertmyHeight();

	if(tm<=1215){
	if(tm<815) tm=815;
	document.getElementById('idbar').style.height=tm+"px";
	document.getElementById('idScrollableArea').style.height=tm+"px";}
	else {
	document.getElementById('idbar').style.height=1215+"px";
	document.getElementById('idScrollableArea').style.height=1215+"px";
	}
	document.getElementById('idwrap').style.height=tm+"px";
	
	var colorWdth=wth*(wth/795);
	document.getElementById('idScrollableArea').style.width=(colorWdth+50)+"px";
	/*
	document.getElementById('idScrollableArea').style.width=wth+"px";}
	else {
	document.getElementById('idbar').style.width=3000+"px";
	document.getElementById('idScrollableArea').style.width=3000+"px";
	} */
	//alert(document.getElementById('idbar').style.width+'---');
	//alert(wth+'--'+(wth-226)+'--'+(wth-352));
	//alert(document.getElementById('scrollRight1').style.left+'--'+document.getElementById('scrollRight2').style.left);
}


function settextureFolder(id){

   // if(globalFolder!=id){
	
		//document.getElementById('folders_'+globalFolder).className="invisibleq";
		document.getElementById('folders_'+globalFolder).style.visibility="hidden";
		
		globalFolder=id;
		//document.getElementById('folders_'+id).className="visibleq";
		document.getElementById('folders_'+id).style.visibility="visible";
		//alert(id+"------"+document.getElementById('folders_'+id).className);
	//	setPosition1('idtable','idtexture31',910,280);
		if(document.getElementById('idtexture'+id+'_8')) setPosition1('idtable','idtexture'+id+'_8',890,280);
		if(document.getElementById('idtexture'+id+'_9')) setPosition1('idtable','idtexture'+id+'_9',700,380);
	//	setPosition1('idtable','idtexture41',690,490); 
	//	setPosition1('idtable','idtexture7',690,590);
		if(document.getElementById('idtexture'+id+'_0')) setPosition1('idtable','idtexture'+id+'_0',690,590);
		if(document.getElementById('idtexture'+id+'_7')){
	
			setPosition1('idtable','idtexture'+id+'_7',900,500);
		} 
		//alert(document.getElementById('idtexture'+id+'_7')+'----');
		if(document.getElementById('idtexture'+id+'_6'))setPosition1('idtable','idtexture'+id+'_6',800,330);
		if(document.getElementById('idtexture'+id+'_5'))setPosition1('idtable','idtexture'+id+'_5',900,390);
		if(document.getElementById('idtexture'+id+'_4'))setPosition1('idtable','idtexture'+id+'_4',700,380);
		if(document.getElementById('idtexture'+id+'_1'))setPosition1('idtable','idtexture'+id+'_1',800,450);
		if(document.getElementById('idtexture'+id+'_2'))setPosition1('idtable','idtexture'+id+'_2',800,550);
		if(document.getElementById('idtexture'+id+'_3'))setPosition1('idtable','idtexture'+id+'_3',690,500);
		
		//<a id="showTrousers" href="uploads/images/Gallery/trousers/1/1.jpg" title="1.jpg" rel="lightbox[gallery]"> Padidinti </a>
	//	document.getElementById('showTrousers').rel="lightbox[gallery]";
	//	document.getElementById('showTrousers').href="uploads/images/Gallery/"+document.getElementById('menuid_'+id).innerHTML+"/1/1.jpg";
		var charVar=window.location+"";
		charVar=charVar.split("&");
		var dropMenuTitle1=document.getElementById('menuid_'+id).innerHTML;
		dropMenuTitle=dropMenuTitle1.replace(' ','%20');

		document.getElementById('idtrousersIn1').style.backgroundImage='url(uploads/images/Gallery/'+dropMenuTitle+'/Teksturos/1.jpg'+')';
		document.getElementById('idtrousersIn2').style.backgroundImage='url(uploads/images/Gallery/'+dropMenuTitle+'/Teksturos/1.jpg'+')';
		
		document.getElementById('idBalloon').className="balloon";
		setPosition1('idtable','idBalloon',790,330);
		var data=document.getElementById('info'+id).innerHTML.replace('.jpg','').split("__");
		document.getElementById('idBalloon').innerHTML=data[1].replace('_',' ')+" ("+data[3]+")";
		
		document.getElementById('idtname').innerHTML=dropMenuTitle1;//data[1].replace('_',' ');
		texture("/uploads/images/Gallery/"+document.getElementById('menuid_'+id).innerHTML+"/Teksturos/1.jpg",'idtexture'+id+'_1',data[1],data[2]+' Lt',document.getElementById('info'+id).innerHTML);
		//texture('/uploads/images/Gallery/Moterims/Teksturos/1.jpg','idtexture0_1',' HIP_HOP','12 Lt','1__HIP_HOP__12__M__L.png');
	
	//}
	
}
function setmenu(id,txt){
//alert(id+'--');
	document.getElementById(id).innerHTML=txt;
}
function changeBgPos(id,left,top){
//alert(45);
	
	if(document.getElementById(id))document.getElementById(id).style.backgroundPosition=left+"px "+top+"px";

}
