
function blurWindow()
{
 if (this.blur)
 {
  for (var n in document.links)
  {
   document.links[n].onfocus=document.links[n].blur;       
  }
 }
}	

function change2Frames(URI1,F1,URI2,F2) 
{ 
 parent.frames[F1].location.href=URI1;
 parent.frames[F2].location.href=URI2;
 parent.frames[F1].focus();
}

	
	 
function changePicture(pictureNo,pictureObj) 
{
 window.document.images[pictureNo].src = pictureObj.src;
}



function clickPicture(pictureNo,pictureObj) 
{
 window.document.images[pictureNo].src = pictureObj.src;
 blurWindow();
} 

function clickIE() 
{
 if (document.all) 
 {
  return false;
 }
}

 
function clickNS(e) 
{
 if (document.layers||(document.getElementById&&!document.all)) 
 {  
  if (e.which==2||e.which==3) 
  {
   return false;
  }
 }
}


function initNoRightClick()
{
 if (document.layers) 
 {
  document.captureEvents(Event.MOUSEDOWN);
  document.onmousedown=clickNS;
 } 
 else
 {
  document.onmouseup=clickNS;
  document.oncontextmenu=clickIE;
 } 
 document.oncontextmenu=new Function("return false");
}



  
  
function getURLParam(aQueryString, strParamName)
{
 strReturn = "";
 strHref = window.location.href;

 if (strHref.indexOf("?") > -1 )
 {
  for (iParam = 0; iParam < aQueryString.length; iParam++ )
  {
   if (aQueryString[iParam].indexOf(strParamName + "=") > -1 )
   {
    aParam = aQueryString[iParam].split("=");
    strReturn = aParam[1];
    break;
   }
  }
 }
 return strReturn;
}


function switchLanguage(sNewLang)
{
 sCurrentUrl  = window.location.href;
 sQueryString = "";
 sUrlString   = "";
 sParamString = "";
 sNewString   = "";
 sWalk        = "";
 sPage        = "";
 sMaxImg      = "";
 sImageId     = "";
 
 if (sCurrentUrl.indexOf("?") > -1)
 {
  sQueryString = sCurrentUrl.substr(sCurrentUrl.indexOf("?")).toLowerCase();
  sUrlString   = sCurrentUrl.substr(0, sCurrentUrl.indexOf("?")); 
  aQueryString = sQueryString.split("&");
  
  sWalk    = getURLParam(aQueryString, "walk" );
  sPage    = getURLParam(aQueryString, "page" );
  sMaxImg  = getURLParam(aQueryString, "pmax" );
  sImageId = getURLParam(aQueryString, "image");
 }
 else
 {
  sUrlString = sCurrentUrl;
 }
 sNewUrl = sUrlString + "?";

 if ("" != sNewLang) sNewUrl += "lang="   + sNewLang;
 if ("" != sWalk   ) sNewUrl += "&walk="  + sWalk   ;
 if ("" != sPage   ) sNewUrl += "&page="  + sPage   ;
 if ("" != sMaxImg ) sNewUrl += "&pmax="  + sMaxImg ;
 if ("" != sImageId) sNewUrl += "&image=" + sImageId;
 
 window.location.href = sNewUrl;
}  

