

function gpGlobalMouseups(){
	document.onmouseup=function(){
		FaderMaster(Alerts,10,20,undefined,0);
		//FaderMaster(Splash1,10,20,undefined,0);
		//FaderMaster(Splash2,10,20,undefined,0);
		//clearInterval(gpSplashRotateIntvl);
	}
}

function gpSplashInit(){
	if(window.location.search.substr(1).toLowerCase()=="resort2012"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_Resort2012")',600);
		
	} else if(window.location.search.substr(1).toLowerCase()=="springsummer2012"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_SpringSummer2012")',600);
		
	} else if(window.location.search.substr(1).toLowerCase()=="fall2011"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_Fall2011")',600);
		
	} else if(window.location.search.substr(1).toLowerCase()=="springsummer2011"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_SpringSummer2011")',600);
		
	} else if(window.location.search.substr(1).toLowerCase()=="resort2011"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_Resort2011")',600);
		
	} else if(window.location.search.substr(1).toLowerCase()=="fall2010"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_Fall2010")',600);
		
	} else if(window.location.search.substr(1).toLowerCase()=="springsummer2010"){
		gpSplashOnOff="off";
		setTimeout('gpOnMenuClick("m_Main_Lookbook")',300);
		setTimeout('gpOnMenuClick("m_Lookbook_SpringSummer2010")',600);
		
	} else{
		
		gpSplashOnOff="off";
		GenDiv("Splash1");
		GenDiv("Splash2");

		if(gpSplashOnOff=="on"){
			//SPLASH 1
			LoadDiv(Splash1,AssetsPath+"KitchenSink/Splash_Vogue20110910b.png");		
			SetPos(Splash1,385,136);
			//Drag.init(Splash1);
			Splash1.urlink="http://www.vogue.com/vogue-daily/article/gregory-parkinson-on-cream-and-ivory-and-vanilla-rising-to-the-top/";
			Splash1.onmouseover=gpMouseOverStandard;
			Splash1.onmouseout=gpMouseOutStandard;
			Splash1.fnc=function(){
				ReportAction("OpenWindow: "+Splash1.urlink);
				window.open(Splash1.urlink);
				//this.onmouseover=function(){};
				//this.onmouseout=function(){};
				//FaderMaster(this,10,20,undefined,0);
				//FaderMaster(Splash1,10,80,undefined,0);
				//FaderMaster(Splash2,10,80,undefined,0);
			}
			Splash1.onclick=Splash1.fnc;
			Splash1.childNodes[0].onload=function(){
				FaderMaster(this.parentNode,10,80,undefined,100);
				gpSplashWhich=2;
				gpSplashRotateIntvl=setInterval("gpSplashRotate();",4000);
			}
			//SPLASH 2
			LoadDiv(Splash2,AssetsPath+"KitchenSink/Splash_StyleCom20110910a.png");		
			SetPos(Splash2,385,136);
			//Drag.init(Splash2);
			Splash2.urlink="http://www.style.com/fashionshows/review/S2012RTW-GPARKINSON";
			Splash2.onmouseover=gpMouseOverStandard;
			Splash2.onmouseout=gpMouseOutStandard;
			Splash2.fnc=function(){
				ReportAction("OpenWindow: "+Splash2.urlink);
				window.open(Splash2.urlink);
				//this.onmouseover=function(){};
				//this.onmouseout=function(){};
				//FaderMaster(this,10,20,undefined,0);
				//FaderMaster(Splash1,10,80,undefined,0);
				//FaderMaster(Splash2,10,80,undefined,0);
			}
			Splash2.onclick=Splash2.fnc;
			Splash2.childNodes[0].onload=function(){
				//FaderMaster(this.parentNode,10,80,undefined,100);
			}
		}
	}
}

function gpSplashRotate(){
	if(gpSplashOnOff=="on"){
		if(gpSplashWhich==1){
			FaderMaster(Splash1,10,20,undefined,100);
			FaderMaster(Splash2,10,20,undefined,0);
			gpSplashWhich=2;
		} else if(gpSplashWhich==2){
			FaderMaster(Splash1,10,20,undefined,0);
			FaderMaster(Splash2,10,20,undefined,100);
			gpSplashWhich=1;
		}
	} else if(gpSplashOnOff=="off"){
		FaderMaster(Splash1,10,20,undefined,0);
		FaderMaster(Splash2,10,20,undefined,0);
		clearInterval(gpSplashRotateIntvl);		
	}
}

function gpInitAI(_Name,_Ext){
	var SourcePath=AssetsPath+"KitchenSink/"+_Name+_Ext;
	GenDiv(_Name);
	var NameDiv=document.getElementById(_Name);
	LoadDiv(NameDiv,SourcePath);
	NameDiv.onmouseover=gpMouseOverStandard;
	NameDiv.onmouseout=gpMouseOutStandard;
	NameDiv.onclick=function(){
		gpOnMenuClick(this.id);
	}
	//Drag.init(NameDiv);
	gpMainElmnts.push(_Name+_Ext);
	if(StrSrchLeft("SiteHeader",_Name)){
		SetPos(NameDiv,18,0);
		NameDiv.children[0].onload=function(){
			FaderMaster(this.parentNode,10,20,undefined,100);
		}
	} else if(StrSrchLeft("m_Main",_Name)){
		m_Main.Items.push(_Name);
		NameDiv.ItemPos=m_Main.Items.length;
		NameDiv.yPos=m_Main.yStart+(m_Main.ySpace*(NameDiv.ItemPos-1));
		NameDiv.children[0].onload=function(){
			this.parentNode.xPos=m_Main.xStart-this.parentNode.clientWidth;
			SetPos(this.parentNode,this.parentNode.xPos,this.parentNode.yPos);
			FaderMaster(NameDiv,10,20,undefined,100);
		}
	} else if(StrSrchLeft("m_Lookbook",_Name)){
		m_Lookbook.Items.push(_Name);
		NameDiv.ItemPos=m_Lookbook.Items.length;
		NameDiv.yPos=m_Lookbook.yStart+(m_Lookbook.ySpace*(NameDiv.ItemPos-1));
		NameDiv.xPos=m_Lookbook.xStart;
		SetPos(NameDiv,NameDiv.xPos,NameDiv.yPos);
	}
}

function gpInitMainElements(){
	gpMainElmnts=new Array();
	gpActiveMainMenuName="";
	gpActiveLookbookMenuName="";
	gpActiveImageSetName="";
	gpInitAI("SiteHeader",".png");
	//MAIN
	m_Main=new Object();
	m_Main.Justified="Right";
	m_Main.AlphaStart=100;
	m_Main.xStart=350;
	m_Main.yStart=214;
	m_Main.ySpace=69;
	m_Main.Items=new Array();
	gpInitAI("m_Main_Lookbook",".png");
	gpInitAI("m_Main_Press",".png");
	gpInitAI("m_Main_Contact",".png");
	gpInitAI("m_Main_Stockists",".png");
	/*
	gpInitAI("m_Main_Shop",".png");
	m_Main_Shop.urlink="http://gregoryparkinson.myshopify.com/";
	m_Main_Shop.fnc=function(){
		window.open(m_Main_Shop.urlink);
		gpOnMenuClick(m_Main_Shop.id);
	}
	m_Main_Shop.onclick=m_Main_Shop.fnc;
	*/
	//gpInitAI("m_Main_Events",".png");
	//LOOKBOOK
	m_Lookbook=new Object();
	m_Lookbook.Justified="Left";
	m_Lookbook.xStart=m_Main.xStart+270;
	m_Lookbook.yStart=m_Main_Lookbook.yPos;
	m_Lookbook.ySpace=45;
	m_Lookbook.Items=new Array();
	gpInitAI("m_Lookbook_SpringSummer2012",".png");
	gpInitAI("m_Lookbook_Resort2012",".png");
	gpInitAI("m_Lookbook_Fall2011",".png");
	gpInitAI("m_Lookbook_SpringSummer2011",".png");
	gpInitAI("m_Lookbook_Resort2011",".png");
	gpInitAI("m_Lookbook_Fall2010",".png");
	gpInitAI("m_Lookbook_SpringSummer2010",".png");
	//gpInitAI("m_Lookbook_Resort2009",".png");
	//MISC
	gpInitAI("gpComingSoon",".png");
	//STOCKISTS
	m_Stockists=new Object();
	m_Stockists.Justified="Left";
	m_Stockists.AlphaStart=0;
	m_Stockists.xStart=m_Main.xStart+270;
	m_Stockists.yStart=m_Main_Stockists.yPos;
	m_Stockists.ySpace=45;
	m_Stockists.Items=new Array();
}

function gpInitContact(){
	GenDiv("Contact01_Address");
	GenDiv("Contact02_GeneralHeader");
	GenDiv("Contact02_GeneralEmail");
	GenDiv("Contact03_RetailHeader");
	GenDiv("Contact03_RetailEmail");
	GenDiv("Contact04_PRHeader");
	GenDiv("Contact04_PREmail");
	LoadDiv(Contact01_Address,AssetsPath+"KitchenSink/Contact01_Address.png");
	LoadDiv(Contact02_GeneralHeader,AssetsPath+"KitchenSink/Contact02_GeneralHeader.png");
	LoadDiv(Contact02_GeneralEmail,AssetsPath+"KitchenSink/Contact02_GeneralEmail.png");
	LoadDiv(Contact03_RetailHeader,AssetsPath+"KitchenSink/Contact03_RetailHeader.png");
	LoadDiv(Contact03_RetailEmail,AssetsPath+"KitchenSink/Contact03_RetailEmail.png");
	LoadDiv(Contact04_PRHeader,AssetsPath+"KitchenSink/Contact04_PRHeader.png");
	LoadDiv(Contact04_PREmail,AssetsPath+"KitchenSink/Contact04_PREmail.png");
	Contact02_GeneralEmail.onmouseover=gpMouseOverStandard;
	Contact02_GeneralEmail.onmouseout=gpMouseOutStandard;
	Contact02_GeneralEmail.onclick=function(){
		DoEmail("info@gregoryparkinson.com");
	}
	Contact03_RetailEmail.onmouseover=gpMouseOverStandard;
	Contact03_RetailEmail.onmouseout=gpMouseOutStandard;
	Contact03_RetailEmail.onclick=function(){
		DoEmail("shop@gregoryparkinson.com");
	}
	Contact04_PREmail.onmouseover=gpMouseOverStandard;
	Contact04_PREmail.onmouseout=gpMouseOutStandard;
	Contact04_PREmail.onclick=function(){
		DoEmail("umindi@ufcgpr.com");
	}
}

function gpContactToggle(OnOff){
	var BatchFaderObj = new Object();
	BatchFaderObj.DivArr=[Contact01_Address, gpSendMessage, Button_Send, Contact02_GeneralHeader, Contact02_GeneralEmail, Contact03_RetailHeader, Contact03_RetailEmail, Contact04_PRHeader, Contact04_PREmail];
	//Drag.init(gpSendMessage);
	if(OnOff=="on"){
		SetPos(Contact01_Address,425,parseInt(m_Main_Lookbook.style.top));
		SetPos(Contact02_GeneralHeader,parseInt(Contact01_Address.style.left),parseInt(Contact01_Address.style.top)+182);
		SetPos(Contact02_GeneralEmail,parseInt(Contact02_GeneralHeader.style.left),parseInt(Contact02_GeneralHeader.style.top)+24);
		SetPos(Contact03_RetailHeader,parseInt(Contact02_GeneralEmail.style.left),parseInt(Contact02_GeneralEmail.style.top)+38);
		SetPos(Contact03_RetailEmail,parseInt(Contact03_RetailHeader.style.left),parseInt(Contact03_RetailHeader.style.top)+24);
		SetPos(Contact04_PRHeader,parseInt(Contact03_RetailEmail.style.left),parseInt(Contact03_RetailEmail.style.top)+39);
		SetPos(Contact04_PREmail,parseInt(Contact04_PRHeader.style.left),parseInt(Contact04_PRHeader.style.top)+49);
		SetPos(gpSendMessage,775,215);
		SetPos(Button_Send,GetDivStats("left",gpSendMessage),GetDivStats("top",gpSendMessage)+40);
		FaderBatchMaster(BatchFaderObj, 75, 10, 20, undefined, 100);
		Button_Send.onmouseover=gpMouseOverStandard;
		Button_Send.onmouseout=gpMouseOutStandard;
		Button_Send.style.zIndex=gpSendMessage.style.zIndex+1;
		Button_Send.onmouseup=function(){
			FormFncCommon(gpSendMessage,"Submit");
		}
	} else if(OnOff=="off"){
		Button_Send.onmouseover=function(){};
		Button_Send.onmouseout=function(){};
		Button_Send.onmouseup=function(){};
		FaderBatchMaster(BatchFaderObj,20,10,10,undefined,0);
	}
}

function gpInitStockists(){
	GenDiv("Stockists_LindaDresner");
	GenDiv("Stockists_Ikram");
	GenDiv("Stockists_Capitol");
	GenDiv("Stockists_Savannah");
	GenDiv("Stockists_Heist");
	GenDiv("Stockists_Amarees");
	GenDiv("Stockists_Sister");
	GenDiv("Stockists_MarissasCollections");
	GenDiv("Stockists_SharisPlace");
	GenDiv("Stockists_SeasideLuxe");
	GenDiv("Stockists_22Knots");
	GenDiv("Stockists_TheGroceryStore");
	GenDiv("Stockists_Zoe");
	GenDiv("Stockists_Italy");
	GenDiv("Stockists_AnnaRavazzoli");
	GenDiv("Stockists_BiniSilvia");
	GenDiv("Stockists_MimmaNini");
	LoadDiv(Stockists_LindaDresner,AssetsPath+"KitchenSink/Stockists_LindaDresner.png");
	LoadDiv(Stockists_Ikram,AssetsPath+"KitchenSink/Stockists_Ikram.png");
	LoadDiv(Stockists_Capitol,AssetsPath+"KitchenSink/Stockists_Capitol.png");
	LoadDiv(Stockists_Savannah,AssetsPath+"KitchenSink/Stockists_Savannah.png");
	LoadDiv(Stockists_Heist,AssetsPath+"KitchenSink/Stockists_Heist.png");
	LoadDiv(Stockists_Amarees,AssetsPath+"KitchenSink/Stockists_Amarees.png");
	LoadDiv(Stockists_Sister,AssetsPath+"KitchenSink/Stockists_Sister.png");
	LoadDiv(Stockists_MarissasCollections,AssetsPath+"KitchenSink/Stockists_MarissasCollections.png");
	LoadDiv(Stockists_SharisPlace,AssetsPath+"KitchenSink/Stockists_SharisPlace.png");
	LoadDiv(Stockists_SeasideLuxe,AssetsPath+"KitchenSink/Stockists_SeasideLuxe.png");
	LoadDiv(Stockists_22Knots,AssetsPath+"KitchenSink/Stockists_22Knots.png");
	LoadDiv(Stockists_TheGroceryStore,AssetsPath+"KitchenSink/Stockists_TheGroceryStore.png");
	LoadDiv(Stockists_Zoe,AssetsPath+"KitchenSink/Stockists_Zoe.png");
	LoadDiv(Stockists_Italy,AssetsPath+"KitchenSink/Stockists_Italy.png");
	LoadDiv(Stockists_AnnaRavazzoli,AssetsPath+"KitchenSink/Stockists_AnnaRavazzoli.png");
	LoadDiv(Stockists_BiniSilvia,AssetsPath+"KitchenSink/Stockists_BiniSilvia.png");
	LoadDiv(Stockists_MimmaNini,AssetsPath+"KitchenSink/Stockists_MimmaNini.png");
	SetPos(Stockists_LindaDresner,435,180);
	SetPos(Stockists_Ikram,parseInt(Stockists_LindaDresner.style.left),parseInt(Stockists_LindaDresner.style.top)+21);
	SetPos(Stockists_Capitol,parseInt(Stockists_Ikram.style.left),parseInt(Stockists_Ikram.style.top)+21);
	SetPos(Stockists_Savannah,parseInt(Stockists_Capitol.style.left),parseInt(Stockists_Capitol.style.top)+21);
	SetPos(Stockists_Heist,parseInt(Stockists_Savannah.style.left),parseInt(Stockists_Savannah.style.top)+21);
	SetPos(Stockists_Amarees,parseInt(Stockists_Heist.style.left),parseInt(Stockists_Heist.style.top)+21);
	SetPos(Stockists_Sister,parseInt(Stockists_Amarees.style.left),parseInt(Stockists_Amarees.style.top)+21);
	SetPos(Stockists_MarissasCollections,parseInt(Stockists_Sister.style.left),parseInt(Stockists_Sister.style.top)+21);
	SetPos(Stockists_SharisPlace,parseInt(Stockists_MarissasCollections.style.left),parseInt(Stockists_MarissasCollections.style.top)+21);
	SetPos(Stockists_SeasideLuxe,parseInt(Stockists_SharisPlace.style.left),parseInt(Stockists_SharisPlace.style.top)+21);
	SetPos(Stockists_22Knots,parseInt(Stockists_SeasideLuxe.style.left),parseInt(Stockists_SeasideLuxe.style.top)+21);
	SetPos(Stockists_TheGroceryStore,parseInt(Stockists_22Knots.style.left),parseInt(Stockists_22Knots.style.top)+21);
	SetPos(Stockists_Zoe,parseInt(Stockists_TheGroceryStore.style.left),parseInt(Stockists_TheGroceryStore.style.top)+21);
	SetPos(Stockists_Italy,parseInt(Stockists_Zoe.style.left),parseInt(Stockists_Zoe.style.top)+48);
	SetPos(Stockists_AnnaRavazzoli,parseInt(Stockists_Italy.style.left),parseInt(Stockists_Italy.style.top)+21);
	SetPos(Stockists_BiniSilvia,parseInt(Stockists_AnnaRavazzoli.style.left),parseInt(Stockists_AnnaRavazzoli.style.top)+21);
	SetPos(Stockists_MimmaNini,parseInt(Stockists_BiniSilvia.style.left),parseInt(Stockists_BiniSilvia.style.top)+21);
	StockistAction("Stockists_LindaDresner","http://www.lindadresner.com/STORES.html");
	StockistAction("Stockists_Ikram","http://ikram.com/");
	StockistAction("Stockists_Capitol","http://www.capitolcharlotte.com/");
	StockistAction("Stockists_Savannah","http://savannahsantamonica.com/");
	StockistAction("Stockists_Heist","http://www.shopheist.com/");
	StockistAction("Stockists_Amarees","http://www.amarees.com/");
	StockistAction("Stockists_Sister","");
	StockistAction("Stockists_MarissasCollections","http://www.marissacollections.com/");
	StockistAction("Stockists_SharisPlace","http://www.shopsharis.com/");
	StockistAction("Stockists_SeasideLuxe","http://www.hualalairesort.com/index.cfm/fuseaction/ig.page/PageID/1360");
	StockistAction("Stockists_22Knots",""); //http://www.shops-magazine.com/?p=60
	StockistAction("Stockists_TheGroceryStore","");
	StockistAction("Stockists_Zoe","http://shopzoeonline.com");
	StockistAction("Stockists_Italy","");
	StockistAction("Stockists_AnnaRavazzoli","http://www.annaravazzoli.com/");
	StockistAction("Stockists_BiniSilvia","http://www.binisilvia.it/");
	StockistAction("Stockists_MimmaNini","http://www.mimmaninni.it/");
}

function StockistAction(DivName,urlink){
	DivObj=eval(DivName);
	if(urlink!=""){
		DivObj.onmouseover=gpMouseOverStandard;
		DivObj.onmouseout=gpMouseOutStandard;
		DivObj.onclick=function(){Redirect(urlink,"new");}
	}
}

function gpStockistsToggle(OnOff){
	BatchFaderObj=new Object();
	BatchFaderObj.DivArr=[Stockists_LindaDresner, Stockists_Ikram, Stockists_Capitol, Stockists_Savannah, Stockists_Heist, Stockists_Amarees, Stockists_Sister, Stockists_MarissasCollections, Stockists_SharisPlace, Stockists_SeasideLuxe, Stockists_22Knots, Stockists_TheGroceryStore, Stockists_Zoe, Stockists_Italy, Stockists_AnnaRavazzoli, Stockists_BiniSilvia, Stockists_MimmaNini];
	if(OnOff=="on"){
		FaderBatchMaster(BatchFaderObj,40,10,20,undefined,100);
	} else if(OnOff=="off"){
		FaderBatchMaster(BatchFaderObj,40,10,20,undefined,0);
	}
}

function gpComingSoonToggle(OnOff){
	if(OnOff=="on"){
		SetPos(gpComingSoon,parseInt(m_Main_Shop.style.left)+200,parseInt(m_Main_Shop.style.top)-5);
		FaderMaster(gpComingSoon,10,20,undefined,50);
	} else if(OnOff=="off"){
		FaderMaster(gpComingSoon,10,15,undefined,0);
	}
}

function gpOnMenuClick(DivName){
	ReportAction("Menu: "+DivName);
	if(gpSplashOnOff=="on"){
		gpSplashOnOff="off";
		gpSplashRotate();
	}
	DivObj=document.getElementById(DivName);
	if(DeviceType=="Mobile"){
		FaderMaster(DivObj,10,10,10,100);
	}
	
	//SITEHEADER
	if(DivName=="SiteHeader"){
		//ENG.innerHTML+="SiteHeader click<br>";
		
	//MAIN MENU
	} else if(StrSrchLeft("m_Main",DivName)){
		if(gpActiveMainMenuName!=DivName){
			gpClearStage();
		}
		gpSetMenu("m_Main",100);
		gpActiveMainMenuName=DivName;
		gpActiveMenuObj=document.getElementById(gpActiveMainMenuName);
		if(DivName=="m_Main_Lookbook"){
			gpSetMenu("m_Lookbook",100);
		} else if(DivName=="m_Main_Press"){
			if(gpActiveImageSetName!="Press_"){
				gpClearPlayers();
			}
			gpActiveImageSetName="Press_";
			gpActiveImageSetObj=eval(gpActiveImageSetName);
			gpActiveImageSetObj.ImageNum=(gpActiveImageSetObj.ImageNum==undefined ? 0 : gpActiveImageSetObj.ImageNum);
			gpInitImageSet();
		} else if(DivName=="m_Main_Contact"){
			gpContactToggle("on");
		} else if(DivName=="m_Main_Stockists"){
			gpStockistsToggle("on");
		} else if(DivName=="m_Main_Shop"){
			//Done externally
			//gpComingSoonToggle("on");
		}
		
	//LOOKBOOK
	} else if(StrSrchLeft("m_Lookbook",DivName)){
		if(gpActiveImageSetName!=DivName.substr(2)){
			gpClearPlayers();
			gpActiveLookbookMenuName=DivName;
			gpActiveLookbookMenuObj=document.getElementById(gpActiveLookbookMenuName);
			gpActiveImageSetName=DivName.substr(2);
			gpActiveImageSetObj=eval(gpActiveImageSetName);
			gpActiveImageSetObj.ImageNum=(gpActiveImageSetObj.ImageNum==undefined ? 0 : gpActiveImageSetObj.ImageNum);
			gpInitImageSet();
		}
	}
}

function gpInitPlayers(){
	ImageMoving="";
	var i, PlayerName, PlayerDiv;
	PlayerCount=50;
	for(i=PlayerCount;i>=1;i--){
		PlayerName="Player"+i;
		GenDiv(PlayerName);
		PlayerDiv=document.getElementById(PlayerName);
		//Drag.init(PlayerDiv);
		PlayerDiv.onclick=function(){
			gpNextImage(this.id);
		}
	}
	PlayerZ=PlayerDiv.style.zIndex;
}

function gpNavArrowsInit(){
	GenDiv("ArrowRight");
	LoadDiv(ArrowRight,AssetsPath+"KitchenSink/ArrowRight.png");
	ArrowRight.onmouseover=function(){
		if(DeviceType!="Mobile"){
			FaderMaster(this,10,20,undefined,20);
		}
	}
	ArrowRight.onmouseout=function(){
		FaderMaster(this,10,20,undefined,10);
	}
	GenDiv("ArrowLeft");
	LoadDiv(ArrowLeft,AssetsPath+"KitchenSink/ArrowLeft.png");
	ArrowLeft.onmouseover=function(){
		if(DeviceType!="Mobile"){
			FaderMaster(this,10,20,undefined,20);
		}
	}
	ArrowLeft.onmouseout=function(){
		FaderMaster(this,10,20,undefined,10);
	}

}

function gpNavArrowsUpdate(){
	SetPos(ArrowRight,GetDivStats("right",ActivePlayerDiv),60);
	FaderMaster(ArrowRight,10,20,undefined,10);
	ArrowRight.onclick=function(){
		gpNextImage(RightPlayerDiv.id);
	}
	//
	SetPos(ArrowLeft,GetDivStats("left",ActivePlayerDiv)-ArrowLeft.clientWidth,60);
	FaderMaster(ArrowLeft,10,20,undefined,10);
	ArrowLeft.onclick=function(){
		gpNextImage(LeftPlayerDiv.id);
	}

}

function gpInitImageSet(){
	var i, PlayerName, PlayerDiv;
	PlayerShift=450;
	PlayerDimmed=20;
	ImagePathBase=AssetsPath + gpActiveImageSetName + "/" + "images/";
	for(i=1;i<=gpActiveImageSetObj.FileCount;i++){
		PlayerName="Player"+i;
		PlayerDiv=document.getElementById(PlayerName);
		PlayerDiv.FileName=gpActiveImageSetObj.FileName[i-1];
		PlayerDiv.ImagePath=ImagePathBase+PlayerDiv.FileName;
	}
	gpGetPlayers("Player"+(gpActiveImageSetObj.ImageNum+1));
	LoadDiv(ActivePlayerDiv,ActivePlayerDiv.ImagePath);
	ActivePlayerDiv.children[0].onload=function(){
		//ENG.innerHTML=this.parentNode.id+" loaded<br>";
		SetPos(this.parentNode,GetDivStats("xmid",SiteHeader,this.parentNode),0);
		gpNavArrowsUpdate();
		gpSetMenu("m_Main",100,GetDivStats("left",this.parentNode));
		if(gpActiveMainMenuName=="m_Main_Lookbook"){
			gpSetMenu("m_Lookbook",100,GetDivStats("right",this.parentNode));
		}
		this.parentNode.style.zIndex=PlayerZ;
		FaderMaster(this.parentNode,10,20,undefined,100);
		gpUpdateImageStats();
		LoadDiv(RightPlayerDiv,RightPlayerDiv.ImagePath);
		RightPlayerDiv.children[0].onload=function(){
			//ENG.innerHTML+=this.parentNode.id+" loaded<br>";
			SetPos(this.parentNode,GetDivStats("xmid",SiteHeader,this.parentNode)+PlayerShift,0);
			this.parentNode.style.zIndex=PlayerZ-1;
			FaderMaster(this.parentNode,10,20,undefined,PlayerDimmed);
			LoadDiv(LeftPlayerDiv,LeftPlayerDiv.ImagePath);
			LeftPlayerDiv.children[0].onload=function(){
				//ENG.innerHTML+=this.parentNode.id+" loaded<br>";
				SetPos(this.parentNode,GetDivStats("xmid",SiteHeader,this.parentNode)-PlayerShift,0);
				this.parentNode.style.zIndex=PlayerZ-1;
				FaderMaster(this.parentNode,10,20,undefined,PlayerDimmed);
				for(i=2;i<=gpActiveImageSetObj.FileCount-1;i++){
					PlayerName="Player"+i;
					PlayerDiv=document.getElementById(PlayerName);
					LoadDiv(PlayerDiv,PlayerDiv.ImagePath);
					PlayerDiv.children[0].onload=function(){
						//ENG.innerHTML+=this.parentNode.id+" loaded<br>";
					}
				}
			}
		}
	}
}

function gpClearPlayers(){
	var i, PlayerName, PlayerDiv;
	for(i=1;i<=PlayerCount;i++){
		PlayerName="Player"+i;
		PlayerDiv=document.getElementById(PlayerName);
		ClearDiv(PlayerDiv,0);
	}
}

function gpGetPlayers(PlayerName){
	ActivePlayerName=PlayerName;
	ActivePlayerDiv=document.getElementById(ActivePlayerName);
	ActivePlayerNum=parseInt(ActivePlayerName.replace(/[^0-9]/g, ""));
	ReportAction("PlayerImage: "+ActivePlayerDiv.ImagePath);
	gpActiveImageSetObj.ImageNum=ActivePlayerNum-1;
	RightPlayerNum=(ActivePlayerNum+1>gpActiveImageSetObj.FileCount ? 1 : ActivePlayerNum+1);
	RightPlayerName="Player"+RightPlayerNum;
	RightPlayerDiv=document.getElementById(RightPlayerName);
	LeftPlayerNum=(ActivePlayerNum-1<1 ? gpActiveImageSetObj.FileCount : ActivePlayerNum-1);
	LeftPlayerName="Player"+LeftPlayerNum;
	LeftPlayerDiv=document.getElementById(LeftPlayerName);
	NextRightPlayerNum=(RightPlayerNum+1>gpActiveImageSetObj.FileCount ? 1 : RightPlayerNum+1);
	NextRightPlayerName="Player"+NextRightPlayerNum;
	NextRightPlayerDiv=document.getElementById(NextRightPlayerName);
	NextLeftPlayerNum=(LeftPlayerNum-1<1 ? gpActiveImageSetObj.FileCount : LeftPlayerNum-1);
	NextLeftPlayerName="Player"+NextLeftPlayerNum;
	NextLeftPlayerDiv=document.getElementById(NextLeftPlayerName);
	ActivePlayerDiv.style.zIndex=PlayerZ;
	RightPlayerDiv.style.zIndex=PlayerZ-1;
	LeftPlayerDiv.style.zIndex=PlayerZ-1;
	NextRightPlayerDiv.style.zIndex=PlayerZ-1;
	NextLeftPlayerDiv.style.zIndex=PlayerZ-1;
}

function gpUpdateImageStats(){
	gpImageStats.lrWidth=10;
	gpImageStats.gpCol="#ffffff";
    gpImageStats.style.color="#333333";
    gpImageStats.style.backgroundColor=gpImageStats.gpCol;
    gpImageStats.style.borderLeft="solid "+gpImageStats.gpCol+" "+gpImageStats.lrWidth+"px";
    gpImageStats.style.borderRight="solid "+gpImageStats.gpCol+" "+gpImageStats.lrWidth+"px";
    gpImageStats.style.fontFamily="Arial";
    gpImageStats.style.fontSize="20";
    gpImageStats.style.fontWeight="100";
    gpImageStats.style.textAlign="right";	
    gpImageStats.innerHTML=gpActiveImageSetObj.ReferenceNumber[gpActiveImageSetObj.ImageNum].toUpperCase();
	SetPos(gpImageStats,parseInt(ActivePlayerDiv.style.left)+ActivePlayerDiv.clientWidth-gpImageStats.clientWidth-(gpImageStats.lrWidth*2),parseInt(ActivePlayerDiv.style.top)+ActivePlayerDiv.clientHeight-gpImageStats.clientHeight);
	FaderMaster(gpImageStats,10,20,undefined,30);
	if(gpActiveImageSetObj.urlink!=undefined && gpActiveImageSetObj.urlink[gpActiveImageSetObj.ImageNum]!=""){
		gpImageUrlink.urlink=gpActiveImageSetObj.urlink[gpActiveImageSetObj.ImageNum];
		SetPos(gpImageUrlink,parseInt(ActivePlayerDiv.style.left)+5,GetDivStats("top",gpImageStats)+5);
		FaderMaster(gpImageUrlink,10,20,0,100);
		gpImageUrlink.onmouseover=gpMouseOverStandard;
		gpImageUrlink.onmouseout=gpMouseOutStandard;
		gpImageUrlink.fnc=function(){
			ReportAction("OpenWindow: "+gpImageUrlink.urlink);
			window.open(gpImageUrlink.urlink);
		}
		gpImageUrlink.onclick=gpImageUrlink.fnc;
	} else{
		gpImageUrlink.onmouseover=function(){};
		gpImageUrlink.onmouseout=function(){};
		gpImageUrlink.onclick=function(){};
		FaderMaster(gpImageUrlink,10,10,undefined,0);
	}
}

function gpNextImage(PlayerName){
	var fn=arguments.callee.name;
	if(ImageMoving==true){
		return;
	}
	PlayerDiv=document.getElementById(PlayerName);
	if(PlayerName==ActivePlayerName){
		//Bring up flats
	} else if(PlayerName==RightPlayerName){
		ImageMoving=true;
		FaderMaster(gpImageStats,10,10,undefined,0);
		ActivePlayerDiv.xPos=GetDivStats("xmid",SiteHeader,ActivePlayerDiv)-PlayerShift;
		RightPlayerDiv.xPos=GetDivStats("xmid",SiteHeader,RightPlayerDiv);
		NextRightPlayerDiv.xPos=GetDivStats("xmid",SiteHeader,NextRightPlayerDiv)+PlayerShift;
		//
		$(ActivePlayerDiv).animate({left: ActivePlayerDiv.xPos},500,function(){/*OnComplete*/});
		$(RightPlayerDiv).animate({left: RightPlayerDiv.xPos},500,function(){
			/*OnComplete*/
			gpUpdateImageStats();
			ImageMoving=false;
		});
		SetPos(NextRightPlayerDiv,NextRightPlayerDiv.xPos,0);
		//
		FaderMaster(LeftPlayerDiv,10,20,undefined,0);
		FaderMaster(ActivePlayerDiv,10,20,undefined,PlayerDimmed);
		FaderMaster(RightPlayerDiv,10,20,undefined,100);
		FaderMaster(NextRightPlayerDiv,10,20,undefined,PlayerDimmed);
		gpGetPlayers(RightPlayerName);
	} else if(PlayerName==LeftPlayerName){
		ImageMoving=true;
		FaderMaster(gpImageStats,10,10,undefined,0);
		ActivePlayerDiv.xPos=GetDivStats("xmid",SiteHeader,ActivePlayerDiv)+PlayerShift;
		LeftPlayerDiv.xPos=GetDivStats("xmid",SiteHeader,LeftPlayerDiv);
		NextLeftPlayerDiv.xPos=GetDivStats("xmid",SiteHeader,NextLeftPlayerDiv)-PlayerShift;
		//
		$(ActivePlayerDiv).animate({left: ActivePlayerDiv.xPos},500,function(){/*OnComplete*/});
		$(LeftPlayerDiv).animate({left: LeftPlayerDiv.xPos},500,function(){
			/*OnComplete*/
			gpUpdateImageStats();
			ImageMoving=false;
		});
		SetPos(NextLeftPlayerDiv,NextLeftPlayerDiv.xPos,0);
		//
		FaderMaster(RightPlayerDiv,10,20,undefined,0);
		FaderMaster(ActivePlayerDiv,10,20,undefined,PlayerDimmed);
		FaderMaster(LeftPlayerDiv,10,20,undefined,100);
		FaderMaster(NextLeftPlayerDiv,10,20,undefined,PlayerDimmed);
		gpGetPlayers(LeftPlayerName);
	}
}

function gpSetMenu(MenuName,Alpha,xPos,yPos){
	var MenuObj,DivName, DivObj, fnc, fncIntvl, i;
	MenuObj=eval(MenuName);
	Alpha=(Alpha==undefined ? MenuObj.AlphaStart : Alpha);
	xPos=(xPos==undefined ? MenuObj.xStart : xPos);
	yPos=(yPos==undefined ? MenuObj.yStart : yPos);
	if(gpActiveMainMenuName!=""){
		SetAlpha(FrecciaSinistra,0);
	}
	if(gpActiveLookbookMenuName!=""){
		SetAlpha(FrecciaDestra,0);
	}
	fnc=function(){
		DivName=MenuObj.Items[i];
		DivObj=document.getElementById(DivName);
		$(DivObj).animate({
			left: xPos-(MenuObj.Justified.toLowerCase()=="right" ? DivObj.clientWidth+25 : -25)
		},250,function(){
			//OnComplete
			if((this.id==gpActiveMainMenuName || this.id==gpActiveLookbookMenuName) && Alpha!=0){
				gpSetFreccia(this);
			}
		});
		FaderMaster(DivObj,10,20,undefined,Alpha);
		i++;
		if(i>=MenuObj.Items.length){
			clearInterval(fncIntvl);
		}
	}
	i=0;
	fncIntvl=setInterval(fnc,50);
}

function gpSetFreccia(MenuDiv){
	if(StrSrchLeft("m_Main",MenuDiv.id)){
		FrecciaSinistra.xPos=GetDivStats("right",MenuDiv)+5;
		FrecciaSinistra.yPos=GetDivStats("top",MenuDiv)-15;
		SetPos(FrecciaSinistra,FrecciaSinistra.xPos,FrecciaSinistra.yPos)
		FaderMaster(FrecciaSinistra,10,20,undefined,20);
	} else if(StrSrchLeft("m_Lookbook",MenuDiv.id)){
		FrecciaDestra.xPos=GetDivStats("left",MenuDiv)-15;
		FrecciaDestra.yPos=GetDivStats("top",MenuDiv)-9;
		SetPos(FrecciaDestra,FrecciaDestra.xPos,FrecciaDestra.yPos);
		FaderMaster(FrecciaDestra,10,20,undefined,20);
	}
}

function gpClearStage(){
	gpSetMenu("m_Lookbook",0);
	FaderMaster(ArrowRight,10,5,undefined,0);
	FaderMaster(ArrowLeft,10,5,undefined,0);	
	gpActiveLookbookMenuName="";
	FaderMaster(gpImageStats,10,5,undefined,0);
	gpContactToggle("off");
	gpComingSoonToggle("off");
	gpStockistsToggle("off");
	gpActiveImageSetName="";
	gpClearPlayers();
}

function gpInitForms(){
	var fn=arguments.callee.name;
    FormName="gpLogin";
    FormInputNames=["uid","pwd"];
    FormInputTypes=["text","password"];
    FormInputValues=["",""];
    FormInputLabels=["eMail: ","Password: ",""];
    FormFncCustom="gpLoginAction";
    FormURL="";
    GenForm();
	gpLogin.innerHTML="LOG IN <br>"+gpLogin.innerHTML;
	gpLoginBG.style.backgroundColor="#000000";
    gpLogin.style.color="#000000";
    gpLogin.style.fontFamily="Arial";
    gpLogin.style.fontSize="10";
    gpLogin.style.fontWeight="bold";
    gpLogin.style.textAlign="right";

    FormName="gpSignup";
    FormInputNames=["uid","pwd","pwd_confirm","FirstName","LastName"];
    FormInputTypes=["text","password","password","text","text"];
    FormInputValues=["","","","",""];
    FormInputLabels=["eMail: ","Password: ","Confirm Password: ","First Name: ","Last Name: "];
	FormFncCustom="gpSignupAction";
    FormURL="";
    GenForm();
    gpSignup.innerHTML="SIGN UP <br>"+gpSignup.innerHTML;
	gpSignupBG.style.backgroundColor="#000000";
    gpSignup.style.color="#000000";
    gpSignup.style.fontFamily="Arial";
    gpSignup.style.fontSize="10";
    gpSignup.style.fontWeight="bold";
    gpSignup.style.textAlign="right";

    FormName="gpConfirmation";
    FormInputNames=["uid","Confirmation"];
    FormInputTypes=["text","text"];
    FormInputValues=[Visitor.uid,Visitor.Confirmation];
    FormInputLabels=["eMail: ","Confirmation #"];
	FormFncCustom="gpConfirmationAction";
    FormURL=""; 
    GenForm();
    gpConfirmation.innerHTML="EMAIL CONFIRMATION <br>"+gpConfirmation.innerHTML;
	gpConfirmationBG.style.backgroundColor="#000000";
    gpConfirmation.style.color="#000000";
    gpConfirmation.style.fontFamily="Arial";
    gpConfirmation.style.fontSize="10";
    gpConfirmation.style.fontWeight="bold";
    gpConfirmation.style.textAlign="right";
    
    FormName="gpSendMessage";
    FormInputNames=["Name","email","Message"];
    FormInputTypes=["text","text","textarea"];
    FormInputValues=["","",""];
    FormInputLabels=["Name: ","email: ","Message: "];
    FormFncCustom="gpSendMessageAction";
    FormURL="";
    GenForm();
	gpSendMessageBG.style.backgroundColor="#000000";
    gpSendMessage.innerHTML="SEND MESSAGE <br>"+gpSendMessage.innerHTML;
    gpSendMessage.childNodes["Message"].cols=30;
    gpSendMessage.childNodes["Message"].rows=6;
    gpSendMessage.style.color="#555555";
    gpSendMessage.style.fontFamily="Arial";
    gpSendMessage.style.fontSize="10";
    gpSendMessage.style.fontWeight="bold";
    gpSendMessage.style.textAlign="right";
}


function TableEmpty(tbl){
	for(i=0;i<tbl.rows.length;i+0){
		row=tbl.deleteRow(0);	
	}
}

function TableLoad(tbl,AllInfo){
	ENG.innerHTML+="FoundCount: "+AllInfo.FoundCount+"<br>";
	ENG.innerHTML+="FieldCount: "+AllInfo.FieldCount+"<br>";
	for(r=0;r<AllInfo.FoundCount;r++){
		row=tbl.insertRow(r);
		cell=row.insertCell(0);
		cell.innerHTML=AllInfo.Price.split("|")[r];
		cell.onclick=function(){
			var RowIdx=this.parentNode.rowIndex
			ENG.innerHTML+=RowIdx+"<br>";
			var dltrow=this.parentNode.parentNode.deleteRow(RowIdx);
		}
		cell=row.insertCell(0);
		cell.innerHTML=AllInfo.Description.split("|")[r];
		cell=row.insertCell(0);
		cell.innerHTML=AllInfo.IdxStyle.split("|")[r];
// 		cell=row.insertCell(0);
// 		cell.innerHTML=AllInfo.IDX.split("|")[r];
	}
	SetPos(gpShoppingCartDIV,300,300);
	FaderMaster(gpShoppingCartDIV,10,100,undefined,100);
}



function gpWaitForInits(){
	if(FlashInit==true){
		clearInterval(WaitForInitsIntvl);
	} else{
		CookieFL=swf.childNodes[0].GetVariable("CookieFL");
		SystemCapabilities=swf.childNodes[0].GetVariable("SystemCapabilities");
		//ENG.innerHTML+=CookieFL+" / "+SystemCapabilities+"<br>";
		if(CookieFL!="" && CookieFL!=null && SystemCapabilities!="" && SystemCapabilities!=null){
			FlashInit=true;
		}
	}
	FlashInitCount++;
	FlashInit=(FlashInitCount>FlashInitMax ? true : FlashInit);
}


function gpInitFlash(){
	var fn=arguments.callee.name;
	GenDiv("swf");
	LoadDivEmbed(swf,"dbe10.swf","FlashVars='remote_addr="+remote_addr+"'");
	CookieFL="";
	SystemCapabilities="";
	FlashInit=false;
	FlashInitCount=0;
	FlashInitMax=25;
	if(DeviceType=="Mobile" || http_host=="Local" /*|| DeviceType=="Computer"*/){
		FlashInit=true;
	}
	WaitForInitsIntvl=setInterval("gpWaitForInits();",100);
}

window.onload=function(){
	WebSite="Gregory Parkinson";
	SubSite="";
	ActiveClipset="";
	
	zIndexCount=0;
	GenDiv("ENG");
	SetPos(ENG,1100,0)
	ENG.style.visibility="visible";
	ENG.style.textAlign="right";
	ENG.style.fontSize="12";
	ENG.style.color="#999999";
	
	Arrival=false;
	
	AssetsPath = "gpAssets/";
	sqlPath="dbe10_sql.php";
	emailPath="dbe10_email.php";
	
	NowDate="";
	NowDate_Prior="";
	NowTime="";
	NowTime_Prior="";
	IdxContacts="";
	IdxEmailer="";
	
	Visitor=new Object();
	Visitor.IDX="";
	Visitor.FirstName="";
	Visitor.LastName="";
	Visitor.uid="";
	Visitor.pwd="";
	Visitor.pwd_confirm="";
	Visitor.Confirmation="";
	Visitor.Confirmed="";

	Draggables();
	browser=new Browser();
	SetAlpha(InitDiv,0);
	GetMouseInit();
	GetKeyPressInit();
	DeviceInfo();

	gpInitPlayers();
	gpInitImageSets();
	GenDiv("gpImageStats");
	GenDiv("gpImageUrlink");
	LoadDiv(gpImageUrlink,AssetsPath+"KitchenSink/urlinkPress.png");

	GenDiv("FrecciaSinistra");
	LoadDiv(FrecciaSinistra,AssetsPath+"KitchenSink/FrecciaSinistra.png");
	GenDiv("FrecciaDestra");
	LoadDiv(FrecciaDestra,AssetsPath+"KitchenSink/FrecciaDestra.png");

	GenDiv("gpButton_Login");
	SetPos(gpButton_Login,1020,7);
	gpButton_Login.style.fontSize=10;
	gpButton_Login.style.fontFamily="Arial";
	gpButton_Login.style.color="#999999";
	gpButton_Login.style.fontWeight=900;
	gpButton_Login.innerHTML="Login";
	gpButton_Login.onmouseover=gpMouseOverStandard;
	gpButton_Login.onmouseout=gpMouseOutStandard;
	gpButton_Login.onclick=function(){
		setTimeout('gpFormLaunch("gpLogin");',50);
	}
	//FaderMaster(gpButton_Login,10,20,undefined,100);
	GenDiv("gpButton_SignUp");
	SetPos(gpButton_SignUp,parseInt(gpButton_Login.style.left),parseInt(gpButton_Login.style.top)+17);
	gpButton_SignUp.style.fontSize=gpButton_Login.style.fontSize;
	gpButton_SignUp.style.fontFamily=gpButton_Login.style.fontFamily;
	gpButton_SignUp.style.color=gpButton_Login.style.color;
	gpButton_SignUp.style.fontWeight=gpButton_Login.style.fontWeight;
	gpButton_SignUp.innerHTML="Signup";
	gpButton_SignUp.onmouseover=gpMouseOverStandard;
	gpButton_SignUp.onmouseout=gpMouseOutStandard;
	gpButton_SignUp.onclick=function(){
		setTimeout('gpFormLaunch("gpSignup");',50);
	}
	//FaderMaster(gpButton_SignUp,10,20,undefined,100);
	GenDiv("gpButton_Cart");
	SetPos(gpButton_Cart,parseInt(gpButton_Login.style.left),parseInt(gpButton_Login.style.top)+35);
	gpButton_Cart.style.fontSize=gpButton_Login.style.fontSize;
	gpButton_Cart.style.fontFamily=gpButton_Login.style.fontFamily;
	gpButton_Cart.style.fontWeight=gpButton_Login.style.fontWeight;
	gpButton_Cart.style.color=gpButton_Login.style.color;
	gpButton_Cart.innerHTML="Shopping Cart";
	gpButton_Cart.onmouseover=gpMouseOverStandard;
	gpButton_Cart.onmouseout=gpMouseOutStandard;
	gpButton_Cart.onclick=function(){
		gpShoppingCart_GetCart();
	}
	gpNavArrowsInit();
	//FaderMaster(gpButton_Cart,10,20,undefined,100);

	gpInitShoppingCart();
	gpInitForms();
	gpInitMainElements();
	gpSplashInit();

	GenDiv("Alerts");
	Alerts.style.fontSize=10;
	Alerts.style.fontFamily="Arial";
	Alerts.style.color="#000055";
	Alerts.style.border="solid #dddddd 3px";	
	Alerts.style.backgroundColor="#dddddd";
	Alerts.style.fontWeight=900;
	Alerts.style.textAlign="center";
	
    GenDiv("Button_OK");
    LoadDiv(Button_OK,AssetsPath+"KitchenSink/Button_OK.png");
    GenDiv("Button_Cancel");
    LoadDiv(Button_Cancel,AssetsPath+"KitchenSink/Button_Cancel.png");
	GenDiv("Button_Send");
	LoadDiv(Button_Send,AssetsPath+"KitchenSink/Button_Send.png");
	GenDiv("ToolTip");
	
	gpGlobalMouseups();
	gpInitContact();
	gpInitStockists();
	//OfficialFlashInits();
	gpInitFlash();
	ReportAction("Arrival");

}

















// function GP_LoginSecurityCheck(){
//         SetPos(GP_LoginBG,ActiveThumb.style.left,ActiveThumb.style.top,GP_Login.clientWidth+10,GP_Login.clientHeight+19);
//         FaderMaster(GP_LoginBG,10,20,undefined,75);
//         SetPos(GP_LoginDiv,parseInt(GP_LoginBG.style.left)+5,parseInt(GP_LoginBG.style.top)+2);
//         FaderMaster(GP_LoginDiv,10,20,undefined,75);
//         SetPos(Button_OK,parseInt(GP_LoginBG.style.left)+GP_LoginBG.clientWidth-Button_OK.clientWidth-4,parseInt(GP_LoginBG.style.top)+GP_LoginBG.clientHeight-Button_OK.clientHeight);
//         Button_OK.onmouseover=function(){
//             FaderMaster(this,10,20,undefined,50);
//         }
//         Button_OK.onmouseout=function(){
//             FaderMaster(this,10,20,undefined,100);
//         }
//         Button_OK.onclick=function(){
//             SecurityCheckAuth(ActiveThumb,GP_Login.uid.value,GP_Login.pwd.value);
//         }
//         SetPos(Button_Cancel,parseInt(Button_OK.style.left)-Button_Cancel.clientWidth,Button_OK.style.top);
//         FaderMaster(Button_OK,10,20,undefined,100);
//         Button_Cancel.onmouseover=function(){
//             FaderMaster(this,10,20,undefined,50);
//         }
//         Button_Cancel.onmouseout=function(){
//             FaderMaster(this,10,20,undefined,100);
//         }
//         Button_Cancel.onclick=function(){
//             ThumbAction(ActiveThumb,"Cancel");
//         }
//         FaderMaster(Button_Cancel,10,20,undefined,100);
//         setTimeout("document.GP_Login.uid.focus();",300);
//         pwd="";
//         GP_Login.onkeyup=function(evt){
//             //ENG.innerHTML+=evt.modi+"<br>";
//             if(evt.which==13){//return
//                 evt.target.blur();
//                 SecurityCheckAuth(ActiveThumb,GP_Login.uid.value,pwd.toLowerCase().replace(/\W/g,""));
//             } else if(evt.which==27){//esc
//                 evt.target.blur();
//                 ThumbAction(ActiveThumb,"Cancel");
//             } else if(evt.target.name=="pwd"){
//                 if(evt.which==8){//backspace
//                     pwd=pwd.substr(0,pwd.length-2);
//                 } else {//normal character
//                     pwd+=String.fromCharCode(evt.which).toLowerCase();
//                 }
//             }
//         }
//     }
// }
// 
// function SecurityCheckAuth(ActiveThumb,uid,pwd){
// 	//ENG.innerHTML+=uid+"/"+pwd+"/"+pwd.length+"<br>";
//     VarArr=new Array();
//     VarArr.vAction="get";
//     VarArr.sql_query = "SELECT IDX FROM WebUsers";
//     VarArr.sql_query += " WHERE uid='"+GP_Login.uid.value+"'";
//     VarArr.sql_query += " AND pwd='"+pwd+"'";
//     VarArr.sql_query += " AND SecuritySet='"+ActiveThumb.SecuritySet+"'";
//     //ENG.innerHTML+=VarArr.sql_query+"<br>";
//     //ENG.innerHTML+="SecuritySet: "+ActiveThumb.SecuritySet+"<br>";
//     QueryStr=ArrToStr(VarArr);
//     $.ajax({
//         type: "POST",
//         url: sqlPath,
//         data: QueryStr,
//         success: function(data){
//             ReturnVars=StrToArr(data);
//             //ENG.innerHTML+="FoundCount: "+ReturnVars.FoundCount+"<br>";
//             //ENG.innerHTML+="ReturnVars:"+data+"<br>AsArr: "+ReturnVars+"<br>";
//             if(ReturnVars.FoundCount>0){
//                 ThumbAction(ActiveThumb,true);
//             } else {
//                 ThumbAction(ActiveThumb,false);
//             }
//         }
//     });
// }


