	/* Chakra Gallery Javascript */

	function openPurchase(artid) 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openPurchase1(artid);
		}
		else
		{
			openPurchase2(artid);
		}
	}	
	
	function openPurchase1(artid) {
		url = "PurchaseArt.php?id="+artid;
		window.open(url, "image", "scrollbars=yes,width=555,height=500,resizable=yes");
		return false;
	}
	
	
	function openPurchase2(artid) {
		x = (675 - 675)/2, y = (500 - 500)/2;
	
		if (screen) {
			y = (screen.availHeight - 500)/2;
			x = (screen.availWidth - 675)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 675)/2; 
		}
		url = "PurchaseArt.php?id="+artid;
		window.open(url,'image','scrollbars=yes,resizable=yes,width=555,height=500,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	// View Business Card
	function viewCard(artistid) 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openCard1(artistid);
		}
		else
		{
			openCard2(artistid);
		}
	}	
	
	function openCard1(artistid) {
		url = "/BusinessCard.php?id="+artistid;
		window.open(url, "bcard", "scrollbars=yes,width=350,height=225,resizable=yes");
		return false;
	}
	
	
	function openCard2(artistid) {
		x = (350 - 350)/2, y = (225 - 225)/2;
	
		if (screen) {
			y = (screen.availHeight - 225)/2;
			x = (screen.availWidth - 350)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 350)/2; 
		}
		url = "/BusinessCard.php?id="+artistid;
		window.open(url,'bcard','scrollbars=yes,resizable=yes,width=350,height=225,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	
	// End
	
	// Open Profile
	function openProfile(artistid) 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openProfile1(artistid);
		}
		else
		{
			openProfile2(artistid);
		}
	}	
	
	function openProfile1(artistid) {
		url = "/ArtistProfile.php?id="+artistid;
		window.open(url, "profile", "scrollbars=yes,width=445,height=500,resizable=yes");
		return false;
	}
	
	
	function openProfile2(artistid) {
		x = (445 - 445)/2, y = (500 - 500)/2;
	
		if (screen) {
			y = (screen.availHeight - 500)/2;
			x = (screen.availWidth - 445)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 445)/2; 
		}
		url = "/ArtistProfile.php?id="+artistid;
		window.open(url,'profile','scrollbars=yes,resizable=yes,width=445,height=500,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	// Open Exhibits
	function openExhibits(artistid) 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openExhibits1(artistid);
		}
		else
		{
			openExhibits2(artistid);
		}
	}	
	
	function openExhibits1(artistid) {
		url = "/ArtistExhibits.php?id="+artistid;
		window.open(url, "profile", "scrollbars=yes,width=445,height=500,resizable=yes");
		return false;
	}
	
	
	function openExhibits2(artistid) {
		x = (445 - 445)/2, y = (500 - 500)/2;
	
		if (screen) {
			y = (screen.availHeight - 500)/2;
			x = (screen.availWidth - 445)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 445)/2; 
		}
		url = "/ArtistExhibits.php?id="+artistid;
		window.open(url,'profile','scrollbars=yes,resizable=yes,width=445,height=500,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	
	// End
	
	
	
	// Show and Hide DIV Tags
		function hidediv() {
			if (document.getElementById) { // DOM3 = IE5, NS6
				document.getElementById('Details').style.visibility = 'hidden';
			}
			else {
				if (document.layers) { // Netscape 4
					document.Details.visibility = 'hidden';
				}
				else { // IE 4
					document.all.Details.style.visibility = 'hidden';
				}
			}
		}
		
		function showdiv() {
			if (document.getElementById) { // DOM3 = IE5, NS6
				document.getElementById('Details').style.visibility = 'visible';
			}
			else {
				if (document.layers) { // Netscape 4
					document.Details.visibility = 'visible';
				}
				else { // IE 4
					document.all.Details.style.visibility = 'visible';
				}
			}
		} 
		
		
		// Open Join TOC
	function openJoinTOC() 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openJoinTOC1();
		}
		else
		{
			openJoinTOC2();
		}
	}	
	
	function openJoinTOC1() {
		url = "Join-TOC.php";
		window.open(url, "profile", "scrollbars=yes,width=445,height=500,resizable=yes");
		return false;
	}
	
	
	function openJoinTOC2() {
		x = (445 - 445)/2, y = (500 - 500)/2;
	
		if (screen) {
			y = (screen.availHeight - 500)/2;
			x = (screen.availWidth - 445)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 445)/2; 
		}
		url = "Join-TOC.php";
		window.open(url,'profile','scrollbars=yes,resizable=yes,width=445,height=500,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	// Open Join FAQ
	function openJoinFAQ() 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openJoinFAQ1();
		}
		else
		{
			openJoinFAQ2();
		}
	}	
	
	function openJoinFAQ1() {
		url = "Join-FAQ.php";
		window.open(url, "profile", "scrollbars=yes,width=445,height=500,resizable=yes");
		return false;
	}
	
	
	function openJoinFAQ2() {
		x = (445 - 445)/2, y = (500 - 500)/2;
	
		if (screen) {
			y = (screen.availHeight - 500)/2;
			x = (screen.availWidth - 445)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 445)/2; 
		}
		url = "Join-FAQ.php";
		window.open(url,'profile','scrollbars=yes,resizable=yes,width=445,height=500,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	
	
	// Open Join FAQ
	function openAddServ() 
	{
		if ((navigator.userAgent.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1))
		{
			openAddServ1();
		}
		else
		{
			openAddServ2();
		}
	}	
	
	function openAddServ1() {
		url = "Additional-Services.php";
		window.open(url, "profile", "scrollbars=yes,width=445,height=500,resizable=yes");
		return false;
	}
	
	
	function openAddServ2() {
		x = (445 - 445)/2, y = (500 - 500)/2;
	
		if (screen) {
			y = (screen.availHeight - 500)/2;
			x = (screen.availWidth - 445)/2;
		}
		if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - 445)/2; 
		}
		url = "Additional-Services.php";
		window.open(url,'profile','scrollbars=yes,resizable=yes,width=445,height=500,screenX='+x+',screenY='+y+',top='+y+',left='+x);
	}
	
	
	// End