var browserName=navigator.appName;
var expiration=new Date();
var version=parseFloat(navigator.appVersion); 
expiration.setTime(expiration.getTime()+120000);
var curCookie="java=1; expires=" + expiration.toGMTString()+";";
document.cookie=curCookie;

var strMesgX;
var strMesgY;

function report_key(e){
strMesgX=e.x;
strMesgY=e.y;
}

if ((browserName.indexOf('Netscape')>=0) && (version<5)) value1="nav=0";
else if (browserName.indexOf('Netscape')>=0) value1="nav=1";
else value1="nav=2";

var navCookie=value1+"; expires=" + expiration.toGMTString()+";";
document.cookie=navCookie;

var width=0;
var DHTML_texts=new Array(
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=my_gallery.php>My Gallery</a></div>" + 
"<div class=lnks>&nbsp;<a href=gallery_new.php>New Additions</a></div>" + 
"<div class=lnks>&nbsp;<a href=gallery_all.php>All Artworks</a></div>" + 
"<div class=lnks>&nbsp;<a href=gallery_personal.php>Personal Exhibition</a></div>" +
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=http://wholesale.paintingofrussia.com target=_blank>Wholesale Gallery</a></div>" + 
"<div class=lnks>&nbsp;<a href=gallery_search.php?category=3>Sculpture Gallery</a></div>" +
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=catalogue.php>Advanced Search</a></div>" + 
"<div class=lnks>&nbsp;<a href=artists.php>Artists Directory</a></div>" + 
"<div class=lnks>&nbsp;<a href=rating.php>Artworks Rating</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>",

"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" +  
"<div class=lnks>&nbsp;<a href=subscribe.php>Newsletter</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=check.php>Order Status</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=pass_admin.php>Password Administration</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=currency.php>Currency Convertor</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=affiliated.php>Partnership Program</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>",
 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=faq.php>FAQ</a></div>" + 
"<div class=lnks>&nbsp;<a href=map.php>Site Guide</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=sale.php>How To Buy</a></div>" + 
"<div class=lnks>&nbsp;<a href=escrow.php>Escrow Service</a></div>" + 
"<div class=lnks>&nbsp;<a href=additional.php>Additional Options</a></div>" + 
"<div class=lnks>&nbsp;<a href=shipping.php>Shipping</a></div>" + 
"<div class=lnks>&nbsp;<a href=guarantee.php>Our Guarantee</a></div>" + 
"<div class=lnks>&nbsp;<a href=testimonials.php>Testimonials</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=about.php>About Gallery</a></div>" + 
"<div class=lnks>&nbsp;<a href=http://artblog.paintingofrussia.com target=_blank>Art Blog</a></div>" + 
"<div class=lnks>&nbsp;<a href=contact.php>Contact Info</a></div>" +
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" +
"<div class=lnks>&nbsp;<a href=privacy.php>Privacy Policy</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=partnership.php>Partnership & Wholesale</a></div>" +
"<div class=lnks>&nbsp;<a href=partner_faq.php>Partnership Program FAQ</a></div>" + 
"<div class=lnks>&nbsp;<a href=part_lnk.php>Trade Traffic</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>",

"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=links1.php>Art-Links Directory</a></div>" + 
"<div class=lnks>&nbsp;<a href=linkus.php>Link To Us</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>" + 
"<div class=lnks>&nbsp;<a href=guestbook.php>Guestbook</a></div>" + 
"<table border=0 cellpadding=0 cellspacing=0 width=100% height=1 bgcolor=#524E5F><tr><td><img src=dot.gif width=1 height=1 border=0></td></tr></table>");

if (self.screen) {width=screen.width;} else if (self.java) {var jkit=java.awt.Toolkit.getDefaultToolkit(); var scrsize=jkit.getScreenSize(); width=scrsize.width;}

if (width==800) {
var gposX=new Array(76,158,267,395);
var gposY=new Array(85,85,85,85);
var gHeight=new Array(0,0,0,0);
var gWidth=new Array(110,130,135,110);
}

if (width==1024) {
var gposX=new Array(76,158,267,395);
var gposY=new Array(85,85,85,85);
var gHeight=new Array(0,0,0,0);
var gWidth=new Array(110,130,135,110);
}

if (width==1152) {
var gposX=new Array(63,142,247,381);
var gposY=new Array(85,85,85,85);
var gHeight=new Array(0,0,0,0);
var gWidth=new Array(135,160,167,135);
}

if (width==1280) {
var gposX=new Array(63,142,247,381);
var gposY=new Array(85,85,85,85);
var gHeight=new Array(0,0,0,0);
var gWidth=new Array(135,160,167,135);
}

var mainTableWidth=750;

if (browserName.indexOf('Netscape')>=0) {
v  = ".top";
l  = ".left";
dS = "document.";
sD = "";
y  = "window.pageYOffset";
iW = "window.innerWidth";
iH = "window.innerHeight";
oW = -8;
}
else {
v  = ".pixelTop";
l  = ".pixelLeft";
dS = "";
sD = ".style";
y  = "document.body.scrollTop";
iW = "document.body.clientWidth";
iH = "document.body.clientHeight";
oW = 0;
}

var dhtml         = null; // Our layer
var isOver        = true;
var myTimer       = setTimeout("HideDHTML()",300);
var intCurrent    = -1;
var intNew        = -2;

var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false

//if ((ns4) || (ie4)) {
//} else {
//	PopUp = no_PopUp;
//}

//function no_PopUp() {
//	return true;
//}


function PopUp() {
	clearTimeout(myTimer);
	intNew = arguments[0]
	if (intCurrent!=intNew) {
		intCurrent=intNew;
		var m_frame=self;
		var m_height="height="+gHeight[intNew];
		var m_width="width="+gWidth[intNew];
		var m_text=DHTML_texts[intNew];
		var layerhtml="<table "+m_width+" border=0 cellpadding=1 cellspacing=0 bgcolor=#524e5f "+m_height+"><tr><td><table width=100% border=0 cellpadding=2 cellspacing=0 bgcolor=#f2f1e2 "+m_height+"><tr><td valign=top>"+m_text+"</td></tr></table></td></tr></table>";	
		if (ns4) {dhtml=m_frame.document.DHTLMenu;}
		if (ie4) {dhtml=m_frame.DHTLMenu.style;}
		SetPosition(intNew);
		dhtml.onmouseover=OverDHTML;
		dhtml.onmouseout=OutDHTML;
		OverDHTML();
		if (ns4) {
			var lyr=dhtml.document;
			lyr.write(layerhtml);
		  	lyr.close();
		  	dhtml.visibility="show";
		} else if (ie4) {
			m_frame.document.all["DHTLMenu"].innerHTML=layerhtml;
			dhtml.visibility="visible";
		}
		return true;
	}
}

function SetPosition(id) {
	var j=eval(iW);
	var posX=0;
	var posY=0;
	
	if (j<=mainTableWidth) {j=2}
	else {j=((j-mainTableWidth)/2)+oW;}
	if (j<2) {j=2;}
	posX=gposX[id]+j;
	var j1=eval(iH);
	var j2=eval(y);
	var j3=j1+j2;
	var j4=gposY[id];
	var j5=j1+j2-j4;
	var j6=gHeight[id];
	var j7=j4-j2;
  	var j8=j4;
	
	if ((j5<j6) && (j5<j7)) {j8=j4-j6-30;}
	if (j8<0) {j8=0;}
	
	posY=j8;
	
	dhtml.left=posX;
  	dhtml.top=posY;
}

function HideDHTML() {
	if (!isOver) { 
		intCurrent=-2;
		if (ns4 && dhtml) {dhtml.visibility = "hide";}
		else if (ie4 && dhtml) {dhtml.visibility = "hidden";}
	}
}

function OverDHTML() { 
	clearTimeout(myTimer); 
	isOver=true; 
}

function OutDHTML() { 
	clearTimeout(myTimer);
	isOver=false; 
	myTimer=setTimeout("HideDHTML()",100);
}

function worep() {
LeftPosition=(screen.width) ? (screen.width)/6 : 0;
TopPosition=(screen.height) ? (screen.height)/8 : 0;
id=window.open("intro.php",8,"scrollbars, width=700,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function worep1() {
LeftPosition=(screen.width) ? (screen.width)/6 : 0;
TopPosition=(screen.height) ? (screen.height)/8 : 0;
id=window.open("intro1.php",8,"scrollbars, width=700,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

var id=null;
function wop(a) {
LeftPosition=(screen.width) ? (screen.width)/3 : 0;
TopPosition=(screen.height) ? (screen.height)/3 : 0;
id=window.open("descr.php?id="+a,a,"scrollbars,height=300,width=300,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wor(a, b) {
LeftPosition=(screen.width) ? (screen.width)/3 : 0;
TopPosition=(screen.height) ? (screen.height)/4 : 0;
id=window.open("bid.php?id="+a+"&ref="+b,a,"scrollbars,height=490,width=600,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woa(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("biograf.php?id="+a,a,"scrollbars,height=600,width=500,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wocp(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("clipping"+a+".php",a,"scrollbars, width=600,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woo(a,b,c) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("order.php?id="+a+"&newcost="+b+"&kid="+c,a,"scrollbars,height=700,width=430,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wos(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("suggestions.php?num="+a,a,"scrollbars,height=600,width=400,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woadd(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("add.php?num="+a,a,"scrollbars,height=350,width=350,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function worem(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("remove.php?num="+a,a,"scrollbars,height=350,width=350,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wol(a, b) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("letter.php?id="+a+"&num="+b,a,"scrollbars,height=450,width=700,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woq(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("inquiry.php?id="+a,a,"scrollbars,height=600,width=700,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woor(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("inqorder.php?id="+a,a,"scrollbars,height=600,width=700,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woi(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("image.php?id="+a,a,"scrollbars,height=500,width=700,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}


function woprc(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("price.php?id="+a,a,"scrollbars,height=500,width=400,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wot(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("tariffs.php?price="+a, 1 ,"scrollbars,height=570,width=500,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wog() {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("guarantees.php",2,"scrollbars,height=500,width=400,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woag() {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("agree.php",2,"scrollbars,height=500,width=400,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function woc(a,b,c,d,e) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("convert.php?price="+a+"&newcost="+b+"&price1="+c+"&price2="+d+"&price3="+e,3,"scrollbars,height=200,width=470,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wof(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("send.php?id="+a,a,"scrollbars,height=600,width=400,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wopass(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("pass.php?email="+a,6,"scrollbars,height=300,width=300,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wopass1(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("pass1.php?email="+a,6,"scrollbars,height=300,width=300,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

function wspass(a) {
LeftPosition=(screen.width) ? (screen.width)/3.5 : 0;
TopPosition=(screen.height) ? (screen.height)/7 : 0;
id=window.open("wpass.php?email="+a,6,"scrollbars,height=300,width=300,top=" + TopPosition + ",left=" + LeftPosition);
if(id.window.focus){id.window.focus();}
}

var DHTML_texts_hlp=new Array("<div class=j>Leave your comments and impressions about the artwork you like. Click on this link to save them for other visitors' consideration.</div>", 
"<div class=j>Send the E-Card with this image to your friends and relatives. You can set the date of delivery for your E-Card. Think about the congratulations in advance!</div>", 
"<div class=j>Send your friend e-mail with your impressions about the artwork or recommend him to see this artwork.</div>",
"<div class=j>Press this button to fill order form for buying the artwork.</div>",
"<div class=j>Press this button to send the order for buying the limited edition of this artwork.</div>",
"<div class=j>Press this button to send the order for buying the reproduction of the artwork.</div>",
"<div class=j>Press this button to send the order for buying the print of this artwork.</div>",
"<div class=j>Press this button to offer your price for the artwork. <b>Submit only serious offers, please.</b></div>",
"<div class=j>What is original?</div>",
"<div class=j>What is limited edition?</div>",
"<div class=j>What is reproduction?</div>",
"<div class=j>What is print?</div>",
"<div class=j>Click this link to send the message to the artist. No commercial offers, please.</div>",
"<div class=j>Ask any information about the artwork you are interested in, that will help you to make the right decision.</div>",
"<div class=j>Ask for the bigger image of the artwork you are interested in for you to see it better and make the final decision.</div>",
"<div class=j>Before ordering artworks from our gallery, please have a look at our guarantees as for the quality of the artworks sold and the return policy.</div>",
"<div class=j>See the cost of this artwork in your currency.</div>",
"<div class=j>See the approximate cost of shipping of this artwork by such express services as DHL and EMS/USPS, and also by simple airmail.</div>",
"<div class=j>View the previous artwork in the gallery.</div>",
"<div class=j>View the previous artwork of this artist in the gallery.</div>",
"<div class=j>View the next artwork of this artist in the gallery.</div>",
"<div class=j>View the next artwork in the gallery.</div>",
"<div class=j>Make an inquiry if it is possible to make the same artwork again.</div>",
"<div class=j>View the previous artwork in My Gallery.</div>",
"<div class=j>View the next artwork in My Gallery.</div>",
"<div class=j>Add this artwork to My Gallery.</div>",
"<div class=j>Remove this artwork from My Gallery.</div>"
);

var dhtmlhlp=null;
var isOverhlp=true;
var myTimerhlp = setTimeout("HideDHTMLhlp()",300);

function PopUpHlp() {
	if (document.hlpf.hlp.checked) {
	clearTimeout(myTimerhlp);
	intNew=arguments[0]
	if (intCurrent!=intNew) {
		intCurrent=intNew;
	}
	var m_frame=self;
	var m_texthlp=DHTML_texts_hlp[intNew];
	var layerhtmlhlp="<table width=160 border=0 cellpadding=1 cellspacing=0 bgcolor=#524E5F><tr><td width=100%><table border=0 cellpadding=5 cellspacing=0 width=100% bgcolor=#F2F1E2><tr bgcolor=#524E5F><td><img src=dot.gif higth=2 border=0></td></tr><tr><td>" + m_texthlp + "</td></tr></table></td></tr></table>";
	if (ns4) {dhtmlhlp=m_frame.document.DHTLMenu;}
	if (ie4) {dhtmlhlp=m_frame.DHTLMenu.style;}
	SetPositionhlp();
	dhtmlhlp.onmouseover=OverDHTMLhlp;
	dhtmlhlp.onmouseout=OutDHTMLhlp;
	OverDHTMLhlp();
	if (ns4) {var lyr=dhtmlhlp.document; lyr.write(layerhtmlhlp); lyr.close(); dhtmlhlp.visibility="show";}
	else if (ie4) {m_frame.document.all["DHTLMenu"].innerHTML=layerhtmlhlp; dhtmlhlp.visibility="visible";}
	return true;
}
}

function SetPositionhlp() {
	if (ns4) {dhtmlhlp.left=strMesgX-65; dhtmlhlp.top=strMesgY+10;}
	else if (ie4) {dhtmlhlp.left=window.event.x-65; dhtmlhlp.top=document.body.scrollTop+window.event.y+10;}

}

function HideDHTMLhlp() {
	if (!isOverhlp) {
		if (document.forms.hlpf.hlp.checked) {
 			intCurrent=-2;
			if (ns4) {dhtmlhlp.visibility = "hide";}
			else if (ie4) {dhtmlhlp.visibility = "hidden";}
		}
	}
}

function OutDHTMLhlp() { 
	clearTimeout(myTimerhlp);
	isOverhlp=false; 
	myTimerhlp=setTimeout("HideDHTMLhlp()",300);
}

function OverDHTMLhlp() { 
	clearTimeout(myTimerhlp); 
	isOverhlp=true; 
}