loaded = 0;

function getURLParam(strParamName) {
    var strReturn = "";
    var strHref = window.location.href;
    if ( strHref.indexOf("?") > -1 ){
        var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
        var aQueryString = strQueryString.split("&");
        for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
            if ( aQueryString[iParam].indexOf(strParamName.toLowerCase() + "=") > -1 ){
                var aParam = aQueryString[iParam].split("=");
                strReturn = aParam[1];
                break;
            }
        }
    }
    return unescape(strReturn);
}
function PopUp(a, msg, look, x, y)
{ //v1.0.4
	var d=document;
	if (!a) {
		var ln="MyPLayer";
		dx = "";
		dy = "";
		b = (d.layers) ? 1 : 0;
		nn=(b||d.getElementById &&!d.all) ? 1 : 0;
		l = new Object();
		loaded = 1;
		l.s = b ? d.layers[ln]:MM_findObj(ln).style;l.r=b?d.layers[ln].document:MM_findObj(ln);
		l.w=function (t) {
			if(b) {
				l.r.write(t);
				l.r.close()
			}
			else l.r.innerHTML=t
		}
		if(b) d.captureEvents(Event.MOUSEMOVE);
		d.onmousemove = function(e) {
			dx = (nn) ? e.pageX : event.x;
			dy = (nn) ?  e.pageY:event.y;
		}
	}
	if (a=="1" && loaded==1) {
		l.s.visibility="hidden"
	}
	if (a=="2" && loaded==1) {
		l.w("<table border=\"0\" cellspacing=\"5\" cellpadding=\"0\"><tr><td class='"+look+"'>"+unescape(msg)+"</td></tr></table>")
		if(d.all) dy=dy+d.body.scrollTop;
		x= (!x) ? 50 : Number(x);
		y= (!y) ? -20 : Number(y);
		l.s.left=dx+x;
		l.s.top=dy+y;
		l.s.visibility='visible'
	}
}
var obj,timer,stopObj,px,sf=navigator.userAgent.indexOf('Safari')!=-1;
function initObjects() {
	var a = initObjects.arguments,i;
	obj=new Array();
	d=(sf || document.all || document.getElementById);
	px = (d) ? "px" : "";
	for(i=0; i<a.length; i++) {
		obj[i] = (d && !sf) ? MM_findObj(a[i]).style : MM_findObj(a[i]);
		obj[i].hClip = (!d) ? obj[i].clip.height : MM_findObj(a[i]).offsetHeight
		obj[i].wClip = (!d) ? obj[i].clip.width : MM_findObj(a[i]).offsetWidth	
		obj[i].v = 0;obj[i].h = 0;
	}
}

function moveObject(v,a,o) {
	if (v=='v' || v=='b') { 
		obj[o].v = ((obj[o].v-a)>0) ? 0 : obj[o].v-a;
		obj[o].v = (obj[o].v<-(obj[o].hClip-obj[0].hClip)) ? -(obj[o].hClip-obj[0].hClip) : obj[o].v;
		if (sf)
			obj[o].style.top= obj[o].v+px;
	       	else obj[o].top=obj[o].v+px;
	}
	if (v=='h' || v=='b') {
		obj[o].h=((obj[o].h-a)>0)?0:obj[o].h-a;
		obj[o].h=(obj[o].h<-(obj[o].wClip-obj[0].wClip))?-(obj[o].wClip-obj[0].wClip):obj[o].h;
		if (sf) obj[o].style.left=obj[o].h+px;
		else obj[o].left=obj[o].h+px;
	}
	if (!stopObj) setTimeout("moveObject('"+v+"',"+a+","+o+")",30)
}
function hideIt() {
	lObj = (document.layers)?MM_findObj('Cover'):MM_findObj('Cover').style;
	lObj.visibility='hidden'
}
function hideIt2() {
	lObj = (document.layers)?MM_findObj('ScrollCover'):MM_findObj('ScrollCover').style;
	lObj.visibility='hidden'
}

var sAPS=0;
function SwitchPhoto(photo,counter) {
	lObj = (document.layers)?MM_findObj('Cover'):MM_findObj('Cover').style;
	MM_findObj('mainPhoto').src=photo;
    lObj.visibility="visible";
	setTimeout("hideIt()",5000);
  sAPS=counter;
}

lOldObj=new Object();
oldCtl = new Object();
oldPrice = new Object();
function SwitchSection(sVal) {
    var cap = "mainCaption" + sVal;
    lObj = (document.layers)?MM_findObj(cap):MM_findObj(cap).style;
    lObj.visibility="visible";
    if (lOldObj!=lObj) lOldObj.visibility = "hidden";
    lOldObj = lObj;

    var btn= "mainBtn" + sVal;
    lObj = (document.layers)?MM_findObj(btn):MM_findObj(btn).style;
    lObj.visibility="visible";
    if (oldCtl!=lObj) oldCtl.visibility = "hidden";
    oldCtl = lObj;

    var btn= "price" + sVal;
    lObj = (document.layers)?MM_findObj(btn):MM_findObj(btn).style;
    lObj.visibility="visible";
    if (oldPrice!=lObj) oldPrice.visibility = "hidden";
    oldPrice = lObj;
}

function MM_swapImgRestore() { //v3.0
	var i, x, a = document.MM_sr;
	for(i=0; a && i< a.length && (x=a[i]) && x.oSrc; i++)
		x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {
		if ((appName=="Netscape") && (parseInt(appVersion)==4)) {
			document.MM_pgW=innerWidth;
			document.MM_pgH=innerHeight;
			onresize=MM_reloadPage;
		}
	}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
		location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
//alert("MM_findobj" + n + "  " +d); 

var p,i,x;
if (!d)
	d=document;
if((p=n.indexOf("?"))>0 && parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
}
if(!(x=d[n]) && d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function openPPack() {
  var look='width='+window.screen.width * .8 +',height='+ window.screen.height * .95;
  //var look='width=400,height=600';
	popwin=window.open('','',look);
	popwin.document.open();
popwin.document.write("<html><head><title>Irari - Esquisses</title><META HTTP-EQUIV=\"imagetoolbar\" CONTENT=\"no\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><style type=\"text/css\"> <!-- BODY {  margin : 10px; } --> </style><body bgcolor=#CCCC99  marginwidth=\"0\" marginheight=\"0\" onBlur=\"window.close()\"><table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td ><a href='javascript:self.close();'><img src='in-rev/irari_presspack_reduced.jpg' border=0 alt=\"Irari - Esquisses\"></a></td></tr></table></body></html>");
	popwin.document.close();
}
function openPPal(item_name, item_num, item_price) {
    popwin = window.open('', '');

	popwin.document.open();
    popwin.document.write("<html><body onLoad=\"document.pp_form.submit();\">");
    popwin.document.write("<form name='pp_form' action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">");
    popwin.document.write('<INPUT type="hidden" name="cmd" value="_cart">');
    popwin.document.write('<INPUT type="hidden" name="business" value="info@irinamikhailova.com">');
    popwin.document.write('<INPUT type="hidden" name="item_name" value="' + item_name + '">');
    popwin.document.write('<INPUT type="hidden" name="item_number" value="' + item_num + '">');
    popwin.document.write('<INPUT type="hidden" name="amount" value="' + item_price + '">');
    popwin.document.write('<INPUT type="hidden" name="currency_code" value="USD">');
    popwin.document.write('<INPUT type="hidden" name="add" value="1">');
    popwin.document.write('<INPUT type="hidden" name="return" value="http://irinamikhailova.com/thanks.htm">');
    popwin.document.write('<INPUT type="hidden" name="cancel_return" value="http://irinamikhailova.com/sorry.htm">');


    popwin.document.write("</form></body></html>");
	popwin.document.close();
}
function showCart() {
    popwin = window.open('', '');

	popwin.document.open();
    popwin.document.write("<html><body onLoad=\"document.pp_form.submit();\">");
    popwin.document.write("<form name='pp_form' action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">");
    popwin.document.write('<INPUT type="hidden" name="cmd" value="_cart">');
    popwin.document.write('<INPUT type="hidden" name="business" value="info@irinamikhailova.com">');
    popwin.document.write('<INPUT type="hidden" name="display" value="1">');

    popwin.document.write("</form></body></html>");
	popwin.document.close();
}
