/*---------------------------------------------
 Libreria di base SITE4NET

 Site4Net E-Solution?? un prodotto realizzato
 da Valerio Maurizio - www.icio.it
 Tutti i diritti riservati?.

----------------------------------------------*/

var NS;
var OP;
var IE4;
var IE5;
var SOWIN;
var IE5WIN;
getAgent();

function getAgent() {
SOWIN = (navigator.userAgent.toLowerCase().indexOf("win") > -1) ? 1 : 0; 
OP = (window.opera) ? 1:0; 
IE4 = (document.all && !OP) ? 1:0; 
IE5 = (IE4 && document.getElementById) ? 1:0; 
IE5WIN = ((IE5) && SOWIN);
NS = (IE4 || IE5 || OP) ? 0:1;
}


// -----------------------------------------------------------------------------------

//
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//
function getPageSize(){

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

function apriWin(sName,sTop,sLeft,sWidth,sHeight,sUrl) {
	wf =  "top="+ sTop + ",left=" + sLeft + ",width=" + sWidth + ",height=" + sHeight +",resizable=yes,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no";
	window.open(sUrl,sName,wf);
}

function chiudiWin() {
	self.opener = self;
	self.close();
}
function tornaIndietro(siteUrl, refUrl) {
	if (refUrl.indexOf(siteUrl)!=-1) {
		if (refUrl.indexOf("Action=Find")!=-1) history.back()
		else document.location=refUrl;
	}
	else document.location=siteUrl;
}
function SetValue(frm, sFrom, sTo) {
	frm.elements[sTo].value = frm.elements[sFrom].value;
}

var theSel = null;
function MenuClick(Sel) {
	if (theSel!=null && theSel!="" && theSel!=Sel) MenuClick(theSel);
	var thisMenu = document.getElementById('cat'+Sel);
	if (thisMenu) {
		if (thisMenu.style.display == "block") {
			thisMenu.style.display = "none";
			theSel='';
		}
		else {
			thisMenu.style.display = "block";
			theSel=Sel;
		     }
		return false;
	}
	else {
		return true;
	}
}

function CheckForm() { //v3.1
  var i,p,p1,q,nm,test,num,min,max,errors='',args=CheckForm.arguments,theForm=args[0];
  for (i=1; i<(args.length-2); i+=3) { 
  test=args[i+2]; val=theForm.elements[args[i]]; if (val) { nm=args[i+1]; if (nm=='') nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isCheck')!=-1) { if (!theForm.elements[args[i]].checked) errors+='- '+nm+' obbligatorio.\n';
      } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');p1=val.lastIndexOf('.');
        if (p<2 || p==(val.length-1) || p1<p || p<0) errors+='- '+nm+' deve essere un indirizzo e-mail.\n';
      } else if (test.indexOf('isNum') != -1) { (NS) ? val = val.replace(",","."):val = val.replace("\.","").replace(",","");
 	for(x=0;x<val.length;x++) { if (val.substring(x,1)!="0") {val=val.substring(x); break;} }
        num = parseFloat(val);  if (val!=''+num) errors+='- '+nm+' deve essere un numero. (' + val + ')\n';  
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' deve essere un numero compreso tra '+min+' e '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' obbligatorio.\n'; }
  } if (errors) {alert('Attenzione:\n'+errors);return false} else {return true}
}

function CheckForm1() { //v3.1
  var i,p,p1,q,nm,test,num,min,max,errors='',args=CheckForm1.arguments,theForm=args[0];
  for (i=1; i<(args.length-2); i+=3) { 
  test=args[i+2]; val=theForm.elements[args[i]]; if (val) { nm=args[i+1]; if (nm=='') nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isCheck')!=-1) { if (!theForm.elements[args[i]].checked) errors+='- '+nm+' required.\n';
      } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');p1=val.lastIndexOf('.');
        if (p<2 || p==(val.length-1) || p1<p || p<0) errors+='- '+nm+' has to be a valid e-mail address.\n';
      } else if (test.indexOf('isNum') != -1) { (NS) ? val = val.replace(",","."):val = val.replace("\.","").replace(",","");
 	for(x=0;x<val.length;x++) { if (val.substring(x,1)!="0") {val=val.substring(x); break;} }
        num = parseFloat(val);  if (val!=''+num) errors+='- '+nm+' has to be a number. (' + val + ')\n';  
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' has to be a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' required.\n'; }
  } if (errors) {alert('Warning:\n'+errors);return false} else {return true}
}
function CheckForm2() { //v3.1
  var i,p,p1,q,nm,test,num,min,max,errors='',args=CheckForm2.arguments,theForm=args[0];
  for (i=1; i<(args.length-2); i+=3) { 
  test=args[i+2]; val=theForm.elements[args[i]]; if (val) { nm=args[i+1]; if (nm=='') nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isCheck')!=-1) { if (!theForm.elements[args[i]].checked) errors+='- '+nm+' verpflichtend.\n';
      } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');p1=val.lastIndexOf('.');
        if (p<2 || p==(val.length-1) || p1<p || p<0) errors+='- '+nm+' muss eine gültige E-Mail adresse werden.\n';
      } else if (test.indexOf('isNum') != -1) { (NS) ? val = val.replace(",","."):val = val.replace("\.","").replace(",","");
 	for(x=0;x<val.length;x++) { if (val.substring(x,1)!="0") {val=val.substring(x); break;} }
        num = parseFloat(val);  if (val!=''+num) errors+='- '+nm+' muss eine zahl sein. (' + val + ')\n';  
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' muss eine zahl zwischen '+min+' und '+max+' werden.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' verpflichtend.\n'; }
  } if (errors) {alert('Achtung:\n'+errors);return false} else {return true}
}

function newCheckForm(theForm) { //v4.0
  var i,p,p1,q,nm,title,test,num,min,max,errors='',eles=theForm.elements;
  for (i=0; i<(theForm.length); i++) { 	
    test=eles[i].getAttribute("ctrl");
	if ((test) && (test!=null) && (test!="")) {
			title=eles[i].getAttribute("title");
			if ((title) && (title!=null) && (title!="")) nm=eles[i].getAttribute("title"); else nm=eles[i].getAttribute("name");
			val=eles[i].value;
			 if ((val) && (val!=null) && (val!="")) {
			  if (test.indexOf('isCheck')!=-1) { if (!eles[i].checked) errors+='- '+nm+' obbligatorio.\n';
			  } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');p1=val.lastIndexOf('.');
				if (p<2 || p==(val.length-1) || p1<p || p<0) errors+='- '+nm+' deve essere un indirizzo e-mail.\n';
			  } else if (test.indexOf('isNum') != -1) { (NS) ? val = val.replace(",","."):val = val.replace("\.","").replace(",","");
			for(x=0;x<val.length;x++) { if (val.substring(x,1)!="0") {val=val.substring(x); break;} }
				num = parseFloat(val);  if (val!=''+num) errors+='- '+nm+' deve essere un numero. (' + val + ')\n';  
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
				  min=test.substring(8,p); max=test.substring(p+1);
				  if (num<min || max<num) errors+='- '+nm+' deve essere un numero compreso tra '+min+' e '+max+'.\n';
			} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' obbligatorio.\n'; } }
  if (errors) {alert('Attenzione:\n'+errors);return false} else {return true} }

function newCheckForm1(theForm) { //v4.0
  var i,p,p1,q,nm,title,test,num,min,max,errors='',eles=theForm.elements;
  for (i=0; i<(theForm.length); i++) { 	
    test=eles[i].getAttribute("ctrl");
	if ((test) && (test!=null) && (test!="")) {
			title=eles[i].getAttribute("title");
			if ((title) && (title!=null) && (title!="")) nm=eles[i].getAttribute("title"); else nm=eles[i].getAttribute("name");
			val=eles[i].value;
			 if ((val) && (val!=null) && (val!="")) {
			  if (test.indexOf('isCheck')!=-1) { if (!eles[i].checked) errors+='- '+nm+' mandatory.\n';
			  } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');p1=val.lastIndexOf('.');
				if (p<2 || p==(val.length-1) || p1<p || p<0) errors+='- '+nm+' must be a valid e-mail address.\n';
			  } else if (test.indexOf('isNum') != -1) { (NS) ? val = val.replace(",","."):val = val.replace("\.","").replace(",","");
			for(x=0;x<val.length;x++) { if (val.substring(x,1)!="0") {val=val.substring(x); break;} }
				num = parseFloat(val);  if (val!=''+num) errors+='- '+nm+' must be a number. (' + val + ')\n';  
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
				  min=test.substring(8,p); max=test.substring(p+1);
				  if (num<min || max<num) errors+='- '+nm+' must be a number between '+min+' and '+max+'.\n';
			} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' mandatory.\n'; } }
  if (errors) {alert('Warning:\n'+errors);return false} else {return true} }

function newCheckForm2(theForm) { //v4.0
  var i,p,p1,q,nm,title,test,num,min,max,errors='',eles=theForm.elements;
  for (i=0; i<(theForm.length); i++) { 	
    test=eles[i].getAttribute("ctrl");
	if ((test) && (test!=null) && (test!="")) {
			title=eles[i].getAttribute("title");
			if ((title) && (title!=null) && (title!="")) nm=eles[i].getAttribute("title"); else nm=eles[i].getAttribute("name");
			val=eles[i].value;
			 if ((val) && (val!=null) && (val!="")) {
			  if (test.indexOf('isCheck')!=-1) { if (!eles[i].checked) errors+='- '+nm+' verpflichtend.\n';
			  } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');p1=val.lastIndexOf('.');
				if (p<2 || p==(val.length-1) || p1<p || p<0) errors+='- '+nm+' muss eine gültige E-Mail adresse werden.\n';
			  } else if (test.indexOf('isNum') != -1) { (NS) ? val = val.replace(",","."):val = val.replace("\.","").replace(",","");
			for(x=0;x<val.length;x++) { if (val.substring(x,1)!="0") {val=val.substring(x); break;} }
				num = parseFloat(val);  if (val!=''+num) errors+='- '+nm+' muss eine zahl sein. (' + val + ')\n';  
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
				  min=test.substring(8,p); max=test.substring(p+1);
				  if (num<min || max<num) errors+='- '+nm+' muss eine zahl zwischen '+min+' und '+max+' werden.\n';
			} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' verpflichtend.\n'; } }
  if (errors) {alert('Achtung:\n'+errors);return false} else {return true} }


function DocFindElement(n) {
	var elem = document.getElementById(n);
	if (!elem) elem = document[n];
	return elem;
}
function getv(n) {
	return DocFindElement(n).value;
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
 }

function CheckNumeric(sNum)
{
	var num;
	if (!NS) sNum = sNum.replace("\.","");
	sNum = sNum.replace(",",".");
	try {	num = parseFloat(sNum);}
	catch (err) {num=0;}
	return num;
}
function Arrotonda(Value,dec)
{
	sVal = (Math.floor((Value*dec)+.0001)/dec).toString();
	sVal = sVal.replace("\.",","); 
	var p = sVal.lastIndexOf(',');
	if (p==-1)	{
		sVal=sVal+","+dec.toString().substring(1);
	} else {
		if ((sVal.length-p)<3 & dec!=undefined) sVal=sVal+"0"; 
	}
	return sVal;
}
var theElem=new Array();
function btnHilight(sName,id,sClass) {
	if (theElem[sName]) 
		theElem[sName].className=sName;
	element=DocFindElement(sName+id);
	if (element) {
		element.className=sClass;
		theElem[sName]=element;
	}
}

function cambiaLingua(url,lingua)
{
	document.location=url+"/m4n/"+lingua+"/Home.html?GN=Area&GV=1";
}

function DoDelMaillist(frm)
{
	if (newCheckForm(frm))
		if (confirm("Sicuro di volerti cancellare?")) {
		{
			var sEmail = frm.elements['Email'].value;
			window.location = "Default.aspx?Action=del&Template=CancellatoSI.html&NextTemplate=CancellatoSI.html&F=Email&V='"+ sEmail +"'";
			return true;
		}
	} 
	return false;
}

function DoDelMaillist1(frm)
{
	if (newCheckForm(frm))
		if (confirm("Are you sure you want to unsubscribe?")) {
		{
			var sEmail = frm.elements['Email'].value;
			window.location = "Default.aspx?Action=del&Template=CancellatoSI.html&NextTemplate=CancellatoSI.html&F=Email&V='"+ sEmail +"'";
			return true;
		}
	} 
	return false;
}

function CenterWindow(Base,Altezza)
{
	var Top = (screen.height) ? (screen.height-Altezza)/2 - 26: 0;
	Top = (Top<0) ? 0 : Top;
	var Left = (screen.width) ? (screen.width-Base)/2 : 0;
	Left = (Left<0) ? 0 : Left;
	window.moveTo(Left,Top);
	window.resizeTo(Base,Altezza);
}

function ResizeWin(elem) {
	var Base = window.offsetWidth;
	var Altezza = window.offsetHeight;
	if (elem) {
		Base = elem.width + 100;
		Altezza = window.document.body.scrollHeight + 35;
	} else {
		Base = window.document.body.scrollWidth + 100;
		Altezza = window.document.body.scrollHeight + 35;
	}
	Base = (Base>screen.width) ? screen.width : Base;
	Altezza = (Altezza>screen.height) ? screen.height : Altezza;
	CenterWindow(Base,Altezza)
	self.focus();
}

function DeleteItem() {
			if (confirm("Si vuole eliminare il prodotto dal carrello?"))
				{ return true } else { return false }
		}
function DeleteAll() {
			if (confirm("Si vogliono eliminare tutti i prodotti dal carrello?"))
				{ return true } else { return false }
		}
function DeleteItem1() {
			if (confirm("Are you sure you want to delete this item?"))
				{ return true } else { return false }
		}
function DeleteAll1() {
			if (confirm("Are you sure you want to empty the basket?"))
				{ return true } else { return false }
		}
function DeleteItem2() {
			if (confirm("Sie mochten das Produkt aus dem Warenkorb loschen?"))
				{ return true } else { return false }
		}
function DeleteAll2() {
			if (confirm("Sie wollen alle Produkte aus dem Warenkorb loschen?"))
				{ return true } else { return false }
		}

function DisableEnableLinks(xHow){
  objLinks = document.links;
  for(i=0;i<objLinks.length;i++){
    objLinks[i].disabled = xHow;
    //link with onclick
    if(objLinks[i].onclick && xHow){  
        objLinks[i].onclick = new Function("return false;" + objLinks[i].onclick.toString().getFuncBody());
    }
    //link without onclick
    else if(xHow){  
      objLinks[i].onclick = function(){return false;}
    }
    //remove return false with link without onclick
    else if(!xHow && objLinks[i].onclick.toString().indexOf("function(){return false;}") != -1){            
      objLinks[i].onclick = null;
    }
    //remove return false link with onclick
    else if(!xHow && objLinks[i].onclick.toString().indexOf("return false;") != -1){  
      strClick = objLinks[i].onclick.toString().getFuncBody().replace("return false;","")
      objLinks[i].onclick = new Function(strClick);
    }
  }
}

function getQSParam(ParamName) {
  // Memorizzo tutta la QueryString in una variabile
  QS=window.location.toString(); 
  // Posizione di inizio della variabile richiesta
  var indSta=QS.indexOf(ParamName); 
  // Se la variabile passata non esiste o il parametro è vuoto, restituisco null
  if (indSta==-1 || ParamName=="") return null; 
  // Posizione finale, determinata da una eventuale &amp; che serve per concatenare più variabili
  var indEnd=QS.indexOf('&amp;',indSta); 
  // Se non c'è una &amp;, il punto di fine è la fine della QueryString
  if (indEnd==-1) indEnd=QS.length; 
  // Ottengo il solore valore del parametro, ripulito dalle sequenze di escape
  var valore = unescape(QS.substring(indSta+ParamName.length+1,indEnd)); 
  // Restituisco il valore associato al parametro 'ParamName'
  return valore; 
  }

String.prototype.getFuncBody = function(){ 
  var str=this.toString(); 
  str=str.replace(/[^{]+{/,"");
  str=str.substring(0,str.length-1);   
  str = str.replace(/\n/gi,"");
  if(!str.match(/\(.*\)/gi))str += ")";
  return str; 
} 
		
function ClearOptions(OptionList) {
 
   // Always clear an option list from the last entry to the first
   for (x = OptionList.length; x >= 0; x--) {
      OptionList[x] = null;
   }
}
 
function AddToOptionList(OptionList, OptionValue, OptionText) {
   // Add option to the bottom of the list
 
   var obj = new Option(OptionText, OptionValue);
   OptionList[OptionList.length] = obj;
}

function fadeAlert(){
alertBox = document.getElementById("alertLayer");
for(i=90;i>0;i--){
alertBox.style.filter = "alpha(opacity="+i+");";
alert("alpha(opacity="+i+");");
}
}

function hideAlert(){
alertBox = document.getElementById("alertLayer");
alertBox.style.visibility = "hidden";}

function makeAlert(aTitle,aMessage){
alertBox = document.getElementById("alertLayer");
alertBox.innerHTML = "<table border=0 width=100% height=100%>" +
"<tr height=5><td colspan=4 class=alertTitle>" + " " + aTitle + "</td></tr>" +
"<tr height=5><td width=5></td></tr>" +
"<tr><td width=5></td><td align=center class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
"<tr height=5><td width=5></td></tr>" +
/*"<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick='hideAlert()' class=okButton><BR></td><td width=5></td></tr>" +*/
"<tr height=5><td width=5></td></tr></table>";
thisText = aMessage.length;
if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

aWidth = (thisText * 5) + 80;
aHeight = 100;
if (aWidth < 150){ aWidth = 200; }
if (aWidth > 350){ aWidth = 350; }
if (thisText > 60){ aHeight = 110; }
if (thisText > 120){ aHeight = 130; }
if (thisText > 180){ aHeight = 150; }
if (thisText > 240){ aHeight = 170; }
if (thisText > 300){ aHeight = 190; }
if (thisText > 360){ aHeight = 210; }
if (thisText > 420){ aHeight = 230; }
if (thisText > 490){ aHeight = 250; }
if (thisText > 550){ aHeight = 270; }
if (thisText > 610){ aHeight = 290; }

alertBox.style.width = aWidth+"px";
alertBox.style.height = aHeight+"px";

var winW = 630, winH = 460;
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 } else {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
}

var ScrollTop = document.body.scrollTop;
 

if (ScrollTop == 0)
{
    if (window.pageYOffset)
        ScrollTop = window.pageYOffset;
    else
        ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
}



alertBox.style.left = (winW - aWidth)/2+"px";
alertBox.style.top = ScrollTop+120+"px";

alertBox.style.visibility = "visible";
//window.scrollTo(0,(winH - aHeight)/3-100);
var t= setTimeout("hideAlert()",3000);
}

/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
	var page_request = false
	page_request = getXMLHttpRequest();
	if (!page_request) return false;

	page_request.onreadystatechange=function(){
	loadpage(page_request, containerid)
	}

	if (bustcachevar) //if bust caching of external page
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime();
		
	page_request.open('GET', url+bustcacheparameter, true);
	page_request.send(null);
}

function loadpage(page_request, containerid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
	if (!document.getElementById) return
	for (i=0; i<arguments.length; i++){
		var file=arguments[i]
		var fileref=""
		if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
			if (file.indexOf(".js")!=-1){ //If object is a js file
				fileref=document.createElement('script')
				fileref.setAttribute("type","text/javascript");
				fileref.setAttribute("src", file);
			}
			else if (file.indexOf(".css")!=-1){ //If object is a css file
				fileref=document.createElement("link")
				fileref.setAttribute("rel", "stylesheet");
				fileref.setAttribute("type", "text/css");
				fileref.setAttribute("href", file);
			}
		}
		if (fileref!=""){
			document.getElementsByTagName("head").item(0).appendChild(fileref)
			loadedobjects+=file+" " //Remember this object as being already added to page
		}
	}
}

// funzione per assegnare l'oggetto XMLHttpRequest
// compatibile con i browsers più recenti e diffusi
function getXMLHttpRequest() {

 var XHR = null;
 
 var browserUtente = navigator.userAgent.toUpperCase();


 // browser standard con supporto nativo
 // non importa il tipo di browser
 if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
  XHR = new XMLHttpRequest();

 // browser Internet Explorer
 // è necessario filtrare la versione 4
 else if(window.ActiveXObject && browserUtente.indexOf("MSIE 4") < 0) {
 
  // la versione 6 di IE ha un nome differente
  // per il tipo di oggetto ActiveX
  if(browserUtente.indexOf("MSIE 5") < 0)
   XHR = new ActiveXObject("Msxml2.XMLHTTP");

  // le versioni 5 e 5.5 invece sfruttano lo stesso nome
  else
   XHR = new ActiveXObject("Microsoft.XMLHTTP");
 }

 return XHR;
} 

function ValidAjax(Tpl,Where,ck,over) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
		//alert(Tpl+" | "+Where);
		ajax.open("get","Default.aspx?ck="+ck+"&overwrite="+over+"&Template="+Tpl+"&VN=STRWHERE&VV="+encodeURIComponent(Where), false);
		ajax.send(null);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				var resp = ajax.responseText;
				//var p = resp.indexOf(" -->");
				//if (p>=0) resp=resp.substring(p+4,resp.length);
				try { if (eval(resp)) return true; }
				catch (err) {alert(err.description+'\n\n'+resp);}
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		} else
				alert("Operazione fallita, errore not ready state " + ajax.readyState);
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}

function ExecuteAjaxUrl(sUrl) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
		ajax.open("get",sUrl, false);
		ajax.send(null);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				var resp = ajax.responseText;
				//var p = resp.indexOf(" -->");
				//if (p>=0) resp=resp.substring(p+4,resp.length);
				try { if (eval(resp)) return true; }
				catch (err) {alert(err.description+'\n\n'+resp);}
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		} else
				alert("Operazione fallita, errore not ready state " + ajax.readyState);
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}

function CheckAjax(Http) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
		ajax.open("get",Http, false);
		ajax.send(null);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				var resp = ajax.responseText;
				return resp;
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		}
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}


function NoteAjax(Tpl,id,ck,txt) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
//		ajax.open("get","Default.aspx?ck="+ck+"&VN=txt&VV="+txt+"&Template="+Tpl+"&VN=STRWHERE&VV="+id, false);
		ajax.open("post","Default.aspx?Action=upd&ck="+ck+"&Template="+Tpl+"&F=ID&V="+id, false);
		ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		ajax.setRequestHeader("Content-length", txt.length+7);
		ajax.setRequestHeader("Connection", "close");
		ajax.send("Notes="+txt);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				var resp = ajax.responseText;
				var p = resp.indexOf(" -->");
				if (p>=0) resp=resp.substring(p+4,resp.length);
				try { if (eval(resp)) return true; }
				catch (err) {alert(resp);}
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		}
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}

function ExecAjaxCarr(act,Item,Quantity,tpl,ck) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
		ajax.open("get","Default.aspx?Action="+act+"&Item="+Item+"&Quantity="+Quantity+"&Template="+tpl+"&ck="+ck, false);
		//alert("Default.aspx?Action="+act+"&Item="+Item+"&Quantity="+Quantity+"&Template="+tpl+"&ck="+ck);
		ajax.send(null);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				var resp = ajax.responseText;
				//var p = resp.indexOf(" -->");
				//if (p>=0) resp=resp.substring(p+4,resp.length);
				try { if (eval(resp)) return true; }
				catch (err) {alert(resp);}
			
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		}
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}

function ValidAjaxPrz(Tpl,fld,val,qta,ck) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
		ajax.open("get","Default.aspx?ck="+ck+"&Template="+Tpl+"&VN=STRWHERE&VV="+fld+"='"+val+"'&VN=QTA&VV="+qta, false);
		ajax.send(null);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				var resp = ajax.responseText;
				//var p = resp.indexOf(" -->");
				//if (p>=0) resp=resp.substring(p+4,resp.length);
				try { if (eval(resp)) return true; }
				catch (err) {alert(resp);}
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		}
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}

function ExecAjax(act,fld,val,tpl,ck) {
	var ajax = getXMLHttpRequest();
	if (ajax) { // syncrona !!
		ajax.open("get","Default.aspx?Action="+act+"&"+fld+"="+val+"&Template="+tpl+"&ck="+ck, false);
		ajax.send(null);
		if(ajax.readyState == 4) {
			if(ajax.status == 200) {
				window.location.reload();
				//window.location.replace(window.location.href);
				return true;
			} else
				alert("Operazione fallita, errore numero " + ajax.status);
		}
	} else 
		alert ('Funzione AJAX non abilitata!');

	return false
}

function CheckRegistration(MyForm,mod,rivenditore) {
	if (DocFindElement("EE")!=null)
	{

		if (MyForm.elements["ID"].value=="" || MyForm.elements["ID"].value.indexOf("@")==-1  || MyForm.elements["ID"].value.indexOf(".")==-1 ) {
			alert ("Il nome utente deve essere un indirizzo e-mail valido!");
			MyForm.elements["ID"].focus();
			return (false);
		}	
		if (MyForm.elements["Password"].value.length<4) {
			alert ("La password deve essere composta almeno di 4 caratteri!");
			MyForm.elements["Password"].focus();
			return (false);
		}
		if (MyForm.elements["Password"].value!=MyForm.elements["RPassword"].value) {
			alert ("La password non coincide con la verifica password!");
			MyForm.elements["Password"].focus();
			return (false);
		}
		var ee;
		if (DocFindElement("EE")!=null) ee = DocFindElement("EE").value;
		var msg ="";
		if (MyForm.elements["Organization"].value!="") {
			if (ee=="IT" & MyForm.elements["OrgCF"].value=="") {
				alert ("Codice Fiscale azienda obbligatorio!");
				return (false);
			}
			if (ee=="IT") msg=ControllaPIVA(MyForm.elements["Piva"].value);
			if (msg!="") {alert(msg); return false;}
		} else {
			if (ee=="IT") msg=ControllaCF(MyForm.elements["Piva"].value);
			if (msg!="") {alert(msg); return false;}
		}
		if (!MyForm.elements["chkDD"].checked) {
			MyForm.elements["DestFullName"].value = "";
			MyForm.elements["DestAddress"].value = "";
			MyForm.elements["DestAddress1"].value = "";
			MyForm.elements["DestZip"].value = "";
			MyForm.elements["DestCountry"].value = "";
			MyForm.elements["DestState"].value = "";
		}
		
		if (rivenditore)
		{
			return CheckForm(MyForm,'ID','Utente','RisEmail','Password','Password','R','RPassword','Verifica Password','R','Piva','Partita IVA','R','Organization','Ragione Sociale','R','Address','Indirizzo','R','Zip','C.a.p.','R','Address1','Localita','R','Country','Provincia','R','State','Nazione','R','Telephone','Telefono','R','Email','E-mail','RisEmail');
		} 
		else 
		{
			return CheckForm(MyForm,'ID','Utente','RisEmail','Password','Password','R','RPassword','Verifica Password','R','Piva','Partita IVA / Cod. Fiscale','R','FullName','Persona / Contatto','R','Address','Indirizzo','R','Zip','C.a.p.','R','Address1','Localita','R','Country','Provincia','R','State','Nazione','R','Telephone','Telefono','R','Email','E-mail','RisEmail');
		}
	}
}

function CheckRegistration1(MyForm,mod,rivenditore) {
	if (DocFindElement("EE")!=null)
	{

		if (MyForm.elements["ID"].value=="" || MyForm.elements["ID"].value.indexOf("@")==-1  || MyForm.elements["ID"].value.indexOf(".")==-1 ) {
			alert ("User name has to be a valid e-mail address!");
			MyForm.elements["ID"].focus();
			return (false);
		}	
		if (MyForm.elements["Password"].value.length<4) {
			alert ("Password has to be at least 4 characters long!");
			MyForm.elements["Password"].focus();
			return (false);
		}
		if (MyForm.elements["Password"].value!=MyForm.elements["RPassword"].value) {
			alert ("The password does not match the verification password!");
			MyForm.elements["Password"].focus();
			return (false);
		}
		var ee;
		if (DocFindElement("EE")!=null) ee = DocFindElement("EE").value;
		var msg ="";
		if (MyForm.elements["Organization"].value!="") {
			if (ee=="IT" & MyForm.elements["OrgCF"].value=="") {
				alert ("Company Tax Id required!");
				return (false);
			}
			if (ee=="IT") msg=ControllaPIVA(MyForm.elements["Piva"].value);
			if (msg!="") {alert(msg); return false;}
		} else {
			if (ee=="IT") msg=ControllaCF(MyForm.elements["Piva"].value);
			if (msg!="") {alert(msg); return false;}
		}
		if (!MyForm.elements["chkDD"].checked) {
			MyForm.elements["DestFullName"].value = "";
			MyForm.elements["DestAddress"].value = "";
			MyForm.elements["DestAddress1"].value = "";
			MyForm.elements["DestZip"].value = "";
			MyForm.elements["DestCountry"].value = "";
			MyForm.elements["DestState"].value = "";
		}
		
		if (rivenditore)
		{
			return CheckForm1(MyForm,'ID','User Name','RisEmail','Password','Password','R','RPassword','Verify Password','R','Piva','VAT number','R','Organization','Organization','R','Address','Address','R','RegImp','Zip','Zip','R','Address1','City','R','Country','Country','R','State','State','R','Telephone','Telephone number','R','Email','E-mail address','RisEmail');
		} 
		else 
		{
			return CheckForm1(MyForm,'ID','User Name','RisEmail','Password','Password','R','RPassword','Verify Password','R','Piva','Tax code / VAT number','R','FullName','Surname and name / Contact person','R','Address','Address','R','Zip','Zip','R','Address1','City','R','Country','Country','R','State','State','R','Telephone','Telephone number','R','Email','E-mail address','RisEmail');
		}
	}
}

function CheckRegistration2(MyForm,mod,rivenditore) {
	if (DocFindElement("EE")!=null)
	{

		if (MyForm.elements["ID"].value=="" || MyForm.elements["ID"].value.indexOf("@")==-1  || MyForm.elements["ID"].value.indexOf(".")==-1 ) {
			alert ("User name muss eine gultige E-Mail Adresse werden!");
			MyForm.elements["ID"].focus();
			return (false);
		}	
		if (MyForm.elements["Password"].value.length<4) {
			alert ("Password muss mindestens 4 Zeichen lang sein!");
			MyForm.elements["Password"].focus();
			return (false);
		}
		if (MyForm.elements["Password"].value!=MyForm.elements["RPassword"].value) {
			alert ("Das Password stimmt nicht mit der Prufung vergessen!");
			MyForm.elements["Password"].focus();
			return (false);
		}
		var ee;
		if (DocFindElement("EE")!=null) ee = DocFindElement("EE").value;
		var msg ="";
		if (MyForm.elements["Organization"].value!="") {
			if (ee=="IT" & MyForm.elements["OrgCF"].value=="") {
				alert ("Unternehmensbesteuerung erforderlich!");
				return (false);
			}
			if (ee=="IT") msg=ControllaPIVA(MyForm.elements["Piva"].value);
			if (msg!="") {alert(msg); return false;}
		} else {
			if (ee=="IT") msg=ControllaCF(MyForm.elements["Piva"].value);
			if (msg!="") {alert(msg); return false;}
		}
		if (!MyForm.elements["chkDD"].checked) {
			MyForm.elements["DestFullName"].value = "";
			MyForm.elements["DestAddress"].value = "";
			MyForm.elements["DestAddress1"].value = "";
			MyForm.elements["DestZip"].value = "";
			MyForm.elements["DestCountry"].value = "";
			MyForm.elements["DestState"].value = "";
		}
		
		if (rivenditore)
		{
			return CheckForm2(MyForm,'ID','User Name','RisEmail','Password','Password','R','RPassword','Password bestatigen','R','Piva','Mehrwertsteuer','R','Organization','Name des Unternehmens','R','Address','Addresse','R','RegImp','Zip','PLZ','R','Address1','Stadt','R','Country','Provinz','R','State','Zustand','R','Telephone','Telefonnummer','R','Email','E-mail addresse','RisEmail');
		} 
		else 
		{
			return CheckForm2(MyForm,'ID','User Name','RisEmail','Password','Password','R','RPassword','Password bestatigen','R','Piva','Abgabenordnung / Mehrwertsteuer','R','FullName','Name und vorname / Kontaktperson','R','Address','Addresse','R','Zip','PLZ','R','Address1','Stadt','R','Country','Provinz','R','Zustand','State','R','Telephone','Telefonnummer','R','Email','E-mail addresse','RisEmail');
		}
	}
}
/**************************************
	Controllo del Codice Fiscale
	Linguaggio: JavaScript
***************************************/

function ControllaCF(cf)
{
	var validi, i, s, set1, set2, setpari, setdisp;
	if( cf == '' )  return '';
	cf = cf.toUpperCase();
	if( cf.length != 16 )
		return "Lunghezza del codice fiscale non\n"
		+"corretta: il codice fiscale dovrebbe essere lungo\n"
		+"esattamente 16 caratteri.\n";
	validi = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
	for( i = 0; i < 16; i++ ){
		if( validi.indexOf( cf.charAt(i) ) == -1 )
			return "Il codice fiscale contiene un carattere non valido `" +
				cf.charAt(i) +
				"'.\nI caratteri validi sono le lettere e le cifre.\n";
	}
	set1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	set2 = "ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ";
	setpari = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	setdisp = "BAKPLCQDREVOSFTGUHMINJWZYX";
	s = 0;
	for( i = 1; i <= 13; i += 2 )
		s += setpari.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) )));
	for( i = 0; i <= 14; i += 2 )
		s += setdisp.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) )));
	if( s%26 != cf.charCodeAt(15)-'A'.charCodeAt(0) )
		return "Codice fiscale non corretto:\n"+
			"il codice di controllo non corrisponde.\n";
	return "";
}
/*****************************************
	Controllo della Partita I.V.A.
	Linguaggio: JavaScript
******************************************/

function ControllaPIVA(pi)
{
	if( pi == '' )  return '';
	if( pi.length != 11 )
		return "Lunghezza della partita IVA non\n" +
			"corretta: la partita IVA dovrebbe essere lunga\n" +
			"esattamente 11 caratteri.\n";
	validi = "0123456789";
	for( i = 0; i < 11; i++ ){
		if( validi.indexOf( pi.charAt(i) ) == -1 )
			return "La partita IVA contiene un carattere non valido `" +
				pi.charAt(i) + "'.\nI caratteri validi sono le cifre.\n";
	}
	s = 0;
	for( i = 0; i <= 9; i += 2 )
		s += pi.charCodeAt(i) - '0'.charCodeAt(0);
	for( i = 1; i <= 9; i += 2 ){
		c = 2*( pi.charCodeAt(i) - '0'.charCodeAt(0) );
		if( c > 9 )  c = c - 9;
		s += c;
	}
	if( ( 10 - s%10 )%10 != pi.charCodeAt(10) - '0'.charCodeAt(0) )
		return "Partita IVA non valida:\n" +
			"il codice di controllo non corrisponde.\n";
	return '';
}


function CheckPiva(sPiva) {
	var p = ControllaPIVA(sPiva.value);
	var c = ControllaCF(sPiva.value);
	var ee;
	if (DocFindElement("EE")!=null) ee = DocFindElement("EE").value;
	if (((p!="" & c!="") || ((p+c)=="")) && ee=="IT") {
		if (p.substring(0,9)=="Lunghezza") p="";
		if (c.substring(0,9)=="Lunghezza") c="";
		if (sPiva.name=="Piva")
			alert("Indicare un Codice Partita I.V.A. corretto per registrarsi come azienda.\n\nInserire un Codice Fiscale valido per registrarsi come privato.\n\n"+p+"\n\n"+c);
		else
			alert("Indicare un Codice Fiscale Azienza corretto..\n\nInserire un Codice Fiscale del titolare in caso di ditte individuali.\n\n"+p+"\n\n"+c);
		sPiva.focus();
	} else {
		Azpf();
	}
}

function CtrlCheckDD(chk)  {
	var dis = true;
	var bg = "Silver";
	if (!chk.checked & DocFindElement("DestFullName").value!="") chk.checked=true;
	if (chk.checked) {
		dis = false;
		bg="white";
	}
	
	DocFindElement("DestFullName").readOnly = dis;
	DocFindElement("DestFullName").style.backgroundColor=bg;
	DocFindElement("DestAddress").readOnly = dis;
	DocFindElement("DestAddress").style.backgroundColor=bg;
	DocFindElement("DestAddress1").readOnly = dis;
	DocFindElement("DestAddress1").style.backgroundColor=bg;
	DocFindElement("DestZip").readOnly = dis;
	DocFindElement("DestZip").style.backgroundColor=bg;
	DocFindElement("DestCountry").readOnly = dis;
	DocFindElement("DestCountry").style.backgroundColor=bg;
	DocFindElement("DestState").readOnly = dis;
	DocFindElement("DestState").style.backgroundColor=bg;
}

function Azpf() {
	var ele = document.forms[0].elements;
	var pcf =DocFindElement("Piva");
	var org = DocFindElement("Organization");
	var acodf = DocFindElement("OrgCF");
	var ecf = DocFindElement("etcCF");
	var epiv = DocFindElement("etcPIVA");
	var ee;
	
	if (DocFindElement("EE")!=null)
		{
			ee = DocFindElement("EE").value;
			CtrlCheckDD(DocFindElement("chkDD"));
			if (ee=="99") {
				DocFindElement('State').style.backgroundColor="white";
				DocFindElement('State').value = "";
				DocFindElement('State').readOnly=false;
			} else {
				DocFindElement('State').style.backgroundColor="#eeeeee";
				DocFindElement('State').value = ee;
				DocFindElement('State').readOnly=true;
			}
			
			if (pcf.value=="" || ee!="IT") {
				pcf.disabled=false;
				org.disabled=false;
				acodf.disabled=false;
				//ecf.style.width="50%";
				ecf.style.display="inline-block";
				ecf.style.visibility="visible";
				epiv.style.display="none";
				epiv.style.visibility="hidden";
			} else {
				pcf.value=pcf.value.toUpperCase();
				acodf.value=acodf.value.toUpperCase();
						
			if (ControllaPIVA(pcf.value)=="") {
				org.disabled=false;
				org.style.backgroundColor="white";
				acodf.disabled=false;
				acodf.style.backgroundColor="white";
				//epiv.style.width="50%";
				epiv.style.display="inline-block";
				epiv.style.visibility="visible";
				ecf.style.display="none";
				ecf.style.visibility="hidden";
			}
			if (ControllaCF(pcf.value)=="") {
				org.value="";
				org.disabled=true;
				org.style.backgroundColor="silver";
				acodf.disabled=true;
				acodf.style.backgroundColor="silver";
				//ecf.style.width="50%";
				ecf.style.display="inline-block";
				ecf.style.visibility="visible";
				epiv.style.display="none";
				epiv.style.visibility="hidden";
			}
		}
	}
}

var imBrw_op=window.opera; var imBrw_ie=document.all && !imBrw_op; var imBrw_ns=document.getElementById && !imBrw_ie; var imEffectEnabled = /MSIE [678]/.test(navigator.userAgent) && navigator.platform == "Win32"; var imLoadList = ""; var imPopupEffect = true; function imGetLayer(sName) {return document.all?document.all[sName]:document.getElementById?document.getElementById(sName) : "";}
function imIEBody(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
function imOpenLocation(sNewLocation){
document.location = sNewLocation; }
function imGetParameter(sParamName) {
var sQueryString = ""; var iStart = 0; var iEnd = 0; if (window.top.location.search != 0)
sQueryString = unescape(window.top.location.search); sParamName = sParamName + "="; if (sQueryString.length > 0) {
iStart = sQueryString.indexOf(sParamName); if ( iStart != -1 ) {
iStart += sParamName.length; iEnd = sQueryString.indexOf("&",iStart); if (iEnd == -1)
iEnd = sQueryString.length; return sQueryString.substring(iStart,iEnd); }
return null; }
return null; }
function imMenuMainHover() {
if (document.getElementById("imMnMn") != null) {
if (document.getElementsByTagName) {
var oList = document.getElementById("imMnMn").getElementsByTagName("LI"); for (var i=0; i<oList.length; i++) {
      oList[i].onmouseover=function() {this.className+=" iehover";}
    oList[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" iehover\\b"), "");}}
}}
}
if (navigator.userAgent.indexOf('MSIE 5.5') != -1 || navigator.userAgent.indexOf('MSIE 6') != -1) imLoadList += "imMenuMainHover();"; function imPreloadImages(sImgNames) {
var sNames = new Array (); sNames = sImgNames.split(","); for(iList = 0 ; iList < sNames.length ; iList++) {
var oImg = new Image(); oImg.src = sNames[iList]; }}
var imOpenedSM = null; var imOpenedSMOld = null; var imOpenedSMOldHeight; var imSMCloseTimer = null; var imSMOpenTimer = null; function imSMSlide(start,stop) {
var sm; var smp; if(start < stop)
sm = imOpenedSM; else
sm = imOpenedSMOld; smp = sm.parentNode || sm.parent; var diff = (stop-start)/10; if((diff < stop-smp.clientHeight && start < stop) || (diff > stop-smp.clientHeight && start > stop))
smp.style.height = (smp.clientHeight+diff) + 'px'; else {
smp.style.height = stop + 'px'; if(start < stop) {
clearInterval(imSMOpenTimer); imSMOpenTimer = null; }
else {
clearInterval(imSMCloseTimer); imSMCloseTimer = null; }}
}
function imSMShow(menu) {
if(navigator.appVersion.indexOf('MSIE 6') == -1 && navigator.appVersion.indexOf('MSIE 5') == -1) {
var imOpenedSMP; var imOpenedSMOldP; if(imSMCloseTimer == null && imSMOpenTimer == null) {
if(menu.parentNode)
var sm = menu.parentNode.getElementsByTagName('ul')[0]; else
var sm = menu.parent.getElementsByTagName('ul')[0]; if(imOpenedSM != null) {
imOpenedSMOld = imOpenedSM; imOpenedSMOldP = imOpenedSMOld.parentNode || imOpenedSMOld.parent; imSMCloseTimer = setInterval('imSMSlide(' + imOpenedSMOldP.offsetHeight + ',' + imOpenedSMOldHeight + ')',10); imOpenedSMOldP.getElementsByTagName('a')[0].blur(); imOpenedSMOldP.getElementsByTagName('a')[0].className = ''; }
if(imOpenedSM != sm) {
imOpenedSM = sm; imOpenedSMP = imOpenedSM.parentNode || imOpenedSM.parent; imOpenedSMOldHeight = imOpenedSMP.offsetHeight; imOpenedSMP.style.height = imOpenedSMOldHeight + 'px'; imOpenedSMP.style.overflow = 'hidden'; menu.focus(); menu.className = 'selected'; imOpenedSM.style.display = ''; while(imSMOpenTimer != null); imSMOpenTimer = setInterval('imSMSlide(' + imOpenedSMOldHeight + ',' + (imOpenedSM.offsetHeight+imOpenedSMOldHeight) + ')',10); }
else
imOpenedSM = null; }}
else {
if(imOpenedSM != null) {
imOpenedSM.style.display = 'none'; imOpenedSM.parentNode.getElementsByTagName('a')[0].focus(); imOpenedSM.parentNode.getElementsByTagName('a')[0].className = ''; }
if(imOpenedSM != menu.parentNode.getElementsByTagName('ul')[0]) {
imOpenedSM = menu.parentNode.getElementsByTagName('ul')[0]; menu.focus(); menu.className = 'selected'; imOpenedSM.style.display = ''; }
else
imOpenedSM = null; }}
function imX5ShowImg(sMode, cW, cH, xC, sFile, sFileZ, iMove) {
document.write('<embed src="res/x5im'+sMode+'.swf?cW='+cW+'&cH='+cH+'&xC='+xC+'&File='+sFile+'&FileZ='+sFileZ+'&Move='+iMove+'" '+
'type="application/x-shockwave-flash" width="'+cW+'" height="'+cH+'" wmode="transparent" menu="false" scale="exactfit" '+
'allowscriptaccess="always" quality="high" flashvars="Licence=Only_For_Incomedia_WebSiteX5&Copyrights=WebSiteX5.com">'+
'</embed>'); }
function imX5ShowAdv(iFullSize, iScale, sFileExt, sSoundExt, sUrl, iPreview) {
document.write('<div id="imWebSiteX5Adv" style="height: '+iFullSize/4+'px; width: '+iFullSize/4+'px; "'+
(iPreview == 0 ? '' : ' onmouseover="imObjIn(this.id);" onmouseout="imObjOut(this.id);"')+'>'+
'<embed id="imWebSiteX5AdvObj" style="left: -'+parseInt(iFullSize-iFullSize/4)+'px" src="x5advcorner.swf?FileExt='+sFileExt+'&SoundExt='+sSoundExt+'&Url='+sUrl+'&Scale='+iScale+'&Preview='+iPreview+'" '+
'type="application/x-shockwave-flash" width="'+iFullSize+'" height="'+iFullSize+'" wmode="transparent" menu="false" '+
'allowscriptaccess="samedomain" quality="high" flashvars="Licence=Only_For_Incomedia_WebSiteX5&Copyrights=WebSiteX5.com">'+
'</embed></div>'); }
var imTimeAdv; function imObjOut(sName) {
imTimeAdv=setTimeout("imSetSize('"+sName+"',0, true);",1500); }
function imObjIn(sName) {
clearTimeout(imTimeAdv); imSetSize(sName,1, true); }
function imSetSize(sName, bVal, bRefresh) {
if (bVal == 0) {
if (bRefresh) imGetLayer(sName).innerHTML = imGetLayer(sName).innerHTML; imGetLayer(sName).style.width = parseInt(imGetLayer(sName+"Obj").width/4)+"px"; imGetLayer(sName).style.height = parseInt(imGetLayer(sName+"Obj").height/4)+"px"; imGetLayer(sName+"Obj").style.left = parseInt(imGetLayer(sName+"Obj").width/4-imGetLayer(sName+"Obj").width)+"px"; }
else{
imGetLayer(sName).style.width = imGetLayer(sName+"Obj").width+"px"; imGetLayer(sName).style.height = imGetLayer(sName+"Obj").height+"px"; imGetLayer(sName+"Obj").style.left = "0px"; }}
function imCodeProt(sAuthor) {
document.oncontextmenu = function(){
alert('Copyrights '+sAuthor+'. All rights reserved.'); return false; }}
function imGetUrl(sUrl) {
var xmlHttp; var sResult; try {
xmlHttp=new XMLHttpRequest(); }
catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e) {
alert("Your browser does not support AJAX!"); return false; }}
}
xmlHttp.open('GET', sUrl, false); xmlHttp.send(null); while (xmlHttp.readyState != 4); if (xmlHttp.status == 200) {
sResult = xmlHttp.responseText; }
else {
sResult = "-1"; }
return sResult; }
function IMTip() {
var el = imGetLayer('imToolTip'); var oldmove; var attached = false; var effect_step = 0; var effect_timer = null; this.imShown = false; this.show = function(obj,content,position,x,y,content_style,must_move,effect,pos_x,pos_y) {
this.imLeft = 0; this.imRight = 0; this.imTop = 0; this.imBottom = 0; el.style.top = '-10000px'; el.style.bottom = ''; el.style.left = '-10000px'; el.style.right = ''; switch(position) {
case 'tl': this.imLeft = 1; this.imTop = 1; break; case 'tr': this.imRight = 1; this.imTop = 1; break; case 'bl': this.imLeft = 1; this.imBottom = 1; break; case 'br': this.imRight = 1; this.imBottom = 1; break; }
this.imX = (x ? x : 0); this.imY = (y ? y : 0); el.style.display = 'none'; el.innerHTML = '<div style=\"' + content_style + '\">' + content + '</div>'; el.imMustMove = must_move; this.imShown = true; switch(effect) {
case 0: el.style.display = ''; break; case 1: clearTimeout(this.effect_timer); this.effect_step = 0; el.style.height = ''; this.fade(); break; case 2: clearTimeout(this.effect_timer); this.effect_step = 0; el.style.height = ''; el.style.opacity = 0.9; el.style.filter = 'alpha(opacity=90)'; el.style.visible='hidden'; el.style.display = ''; elch = el.clientHeight; el.style.display = 'none'; el.style.visible='visible'; this.slide(elch); break; }
if(el.imMustMove == true) {
this.detach(); document.onmousemove = function(e) {
this.imTip.move(e); }; el.onmouseover = function(e) {
imt.move(e); }; }
else {
if(this.imLeft == 1) {
el.style.left = (pos_x != undefined ? pos_x : (this.mouseX-this.imX+10)) + 'px'; }
else {
el.style.right = (pos_x != undefined ? document.documentElement.clientWidth-pos_x : (document.documentElement.clientWidth-this.mouseX-this.imX+10)) + 'px'; }
if(this.imTop == 1) {
el.style.top = (pos_y != undefined ? pos_y : (this.mouseY-this.imY+10)) + 'px'; }
else {
el.style.bottom = (pos_y != undefined ? document.documentElement.clientHeight-pos_y : (document.documentElement.clientHeight-this.mouseY+this.imY+10)) + 'px'; }}
return false; }; this.mousepos = function(evt) {
var e = (evt) ? evt : window.event; this.mouseX = ((e.pageX) ? e.pageX : (e.clientX + document.documentElement.scrollLeft)); this.mouseY = ((e.pageY) ? e.pageY : (e.clientY + document.documentElement.scrollTop)); }; this.attach = function() {
this.attached = true; document.imOldOnMouseMove = document.onmousemove; document.imTip = this; document.onmousemove = function(e) {
this.imTip.mousepos(e); }; }; this.detach = function() {
if(this.attached) {
this.attached = false; document.onmousemove = document.imOldOnMouseMove; }}; this.fade = function() {
if(this.effect_step <= 100) {
el.style.opacity = this.effect_step/100; el.style.filter = "alpha(opacity=" + this.effect_step + ")"; if(this.effect_step == 0) {
el.style.display = ''; }
this.effect_step += 15; this.effect_timer = setTimeout('imt.fade()',50); }}; this.slide = function(height) {
if(this.effect_step <= 100) {
el.style.height = height/100*this.effect_step + 'px'; if(this.effect_step == 0) {
el.style.display = ''; }
this.effect_step += 5; this.effect_timer = setTimeout('imt.slide(' + height + ')',25); }}; this.move = function(evt) {
var e = (evt) ? evt : window.event; if(this.imLeft != 0) {
el.style.left = (((e.pageX) ? e.pageX : (e.clientX + document.documentElement.scrollLeft))-this.imX+10) + 'px'; el.style.right = ''; }
else {
el.style.right = (((e.pageX) ? document.documentElement.clientWidth-e.pageX : (document.documentElement.clientWidth-e.clientX-document.documentElement.scrollLeft))-this.imX+10) + 'px'; el.style.left = ''; }
if(this.imTop != 0) {
el.style.top = (((e.pageY) ? e.pageY : (e.clientY + document.documentElement.scrollTop))-this.imY+10) + 'px'; el.style.bottom = ''; }
else {
el.style.bottom = ((e.pageY ? document.documentElement.clientHeight-e.pageY : (document.documentElement.clientHeight-e.clientY-document.documentElement.scrollTop))-this.imY+10) + 'px'; el.style.top = ''; }}; this.hide = function() {
this.imShown = false; el.style.display = 'none'; el.innerHTML = ''; el.style.top = '-10000px'; el.style.bottom = ''; el.style.left = '-10000px'; el.style.right = ''; document.onmousemove = document.imOldOnMouseMove; el.onmouseover = function(){}; this.attach(); }; }
function imGetPositionX(obj,head) {
var ie7u = navigator.appVersion.indexOf('MSIE') != -1 && navigator.appVersion.indexOf('MSIE 8') == -1; head = head && !ie7u; iX = obj.offsetLeft; if(!head)
do {
obj = obj.parent || obj.parentNode; iX += obj.offsetLeft; }
while(obj.id != 'imPage' && obj.id != 'imSite'); return iX; }
function imGetPositionY(obj,head) {
var ie7u = navigator.appVersion.indexOf('MSIE') != -1 && navigator.appVersion.indexOf('MSIE 8') == -1; head = head && !ie7u; iY = obj.offsetTop; if(!head)
do {
obj = obj.parent || obj.parentNode; iY += obj.offsetTop; }
while(obj.id != 'imPage' && obj.id != 'imSite'); return iY; }
function imTipShow(oLink,iVal,iWidth,sBgColor,sBdColor,sFColor,sFont,iSize,bBold,bItalic,sHtml,iMode,bHead) {
oLink.title = ''; var sStyle = 'position: relative; width: '+iWidth+'px; padding: '+iVal[3]+'px 0 '+iVal[3]+'px 0; margin: '+iVal[5]+'px;'; var sBuf = ''+
'<div style="position: absolute; top: 0; left: 0; width: '+iVal[2]+'px; height: '+iVal[3]+'px; background: url(\'res/t'+iVal[0]+'_'+sBgColor+'.gif\') no-repeat 0 0; overflow: hidden; " ></div>'+
'<div style="position: absolute; top: 0; left: '+iVal[3]+'px; width: '+(iWidth-iVal[2]-iVal[2])+'px; height: '+(iVal[3]-iVal[7])+'px; border-top: '+iVal[7]+'px solid #'+sBdColor+'; background-color: #'+sBgColor+'; overflow: hidden; " ></div>'+
'<div style="position: absolute; top: 0; left: '+(iWidth-iVal[2])+'px; width: '+iVal[2]+'px; height: '+iVal[3]+'px; background: url(\'res/t'+iVal[0]+'_'+sBgColor+'.gif\') no-repeat -'+iVal[2]+'px 0px; overflow: hidden; " ></div>'+
'<div style="position: absolute; bottom: 0; left: 0; width: '+iVal[2]+'px; height: '+iVal[3]+'px; background: url(\'res/t'+iVal[0]+'_'+sBgColor+'.gif\') no-repeat 0px -'+iVal[3]+'px; overflow: hidden; " ></div>'+
'<div style="position: absolute; bottom: 0; left: '+iVal[3]+'px; width: '+(iWidth-iVal[2]-iVal[2])+'px; height: '+(iVal[3]-iVal[7])+'px; border-bottom: '+iVal[7]+'px solid #'+sBdColor+'; background-color: #'+sBgColor+'; overflow: hidden; " ></div>'+
'<div style="position: absolute; bottom: 0; left: '+(iWidth-iVal[2])+'px; width: '+iVal[2]+'px; height: '+iVal[3]+'px; background: url(\'res/t'+iVal[0]+'_'+sBgColor+'.gif\') no-repeat -'+iVal[2]+'px -'+iVal[3]+'px; overflow: hidden; " ></div>'+
'<div style="position: relative; border-left: '+iVal[7]+'px solid #'+sBdColor+'; border-right: '+iVal[7]+'px solid #'+sBdColor+'; background-color: #'+sBgColor+'; padding: 0 '+(3+iVal[7])+'px 0 '+(3+iVal[7])+'px; font: '+iSize+'pt '+sFont+'; color: #'+sFColor+'; '+(bBold==1?'font-weight:bold; ':'')+(bItalic==1?'font-style:italic; ':'')+'">'+
sHtml+
'</div>'; if (iVal[1] != 0)
sBuf += (iVal[1]==1?'<div style="position: absolute; top:-'+(iVal[5]-iVal[7])+'px ; left: '+parseInt(iVal[6]/100*iWidth-iVal[4]/2)+'px; width: '+iVal[4]+'px; height: '+iVal[5]+'px; background: url(\'res/t'+iVal[0]+'_'+sBgColor+'.gif\') no-repeat -'+(iVal[2]*2)+'px 0px; overflow: hidden; " ></div>':'<div style="position: absolute; bottom:-'+(iVal[5]-iVal[7])+'px ; left: '+parseInt(iVal[6]/100*iWidth-iVal[4]/2)+'px; width: '+iVal[4]+'px; height: '+iVal[5]+'px; background: url(\'res/t'+iVal[0]+'_'+sBgColor+'.gif\') no-repeat -'+(iVal[2]*2+iVal[4])+'px 0px; overflow: hidden; " ></div>'); imt.attach(); if(iMode >= 0)
imt.show(oLink,sBuf,(iVal[1] == 2 ? 'bl' : 'tl'),parseInt((iWidth)*iVal[6]/100)+iVal[5],0,sStyle,true,iMode); else {
iX = imGetPositionX(oLink,bHead); iY = imGetPositionY(oLink,bHead); imt.show(oLink,sBuf,(iVal[1] == 2 ? 'bl' : 'tl'),parseInt((iWidth-iVal[4])*iVal[6]/100)+iVal[5],0,sStyle,false,Math.abs(iMode)-1,iX,iY+(iVal[1] == 2 ? -iVal[5] : oLink.offsetHeight+iVal[5])); }
return false; }
function imTipHide(){
imt.hide(); imt.detach(); }
function imFormatInt(i) {
if (i<10) i='0'+i; return i; }
function imShowHour() {
var now=new Date(); imGetLayer("imHour").innerHTML = now.getHours()+':'+imFormatInt(now.getMinutes())+':'+imFormatInt(now.getSeconds())+' '; setTimeout(imShowHour,1000); }
function imShowDate(sDay,sMonth,iMode) {
var now=new Date(); if (iMode == 0)
document.write(sDay.substr(now.getDay()*3,3)+' '+now.getDate()+' '+sMonth.substr(now.getMonth()*3,3)+', '+now.getFullYear()); else
document.write(sDay.substr(now.getDay()*3,3)+', '+sMonth.substr(now.getMonth()*3,3)+' '+now.getDate()+' '+now.getFullYear()); }
var imBGSoundUrl = ''; function imSoundLink(url) {
if(imGetLayer('imBGSound').innerHTML == "")
imGetLayer('imBGSound').innerHTML = "<embed style=\"height:0\" id=\"imBGSoundEmbed\" src=\"" + url + "\" loop=\"false\" autostart=\"true\" hidden=\"true\" />"; else {
if(imGetLayer('imBGSoundEmbed').src.substr(imGetLayer('imBGSoundEmbed').src.length-url.length) != url)
imGetLayer('imBGSound').innerHTML = "<embed style=\"height:0\" id=\"imBGSoundEmbed\" src=\"" + url + "\" loop=\"false\" autostart=\"true\" hidden=\"true\" />"; else
imGetLayer('imBGSound').innerHTML = ""; }}
function imPopUpWin(sUrl,w,h,cb,sb){
if (cb=='yes') 
sProp=''; else {
if ((w==-1) || (h==-1)) {
sProp= 'width='+screen.width+',height='+screen.height+',top=0,left=0,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; } else {
l=(screen.width)?(screen.width-w)/2:100; t=(screen.height)?(screen.height-h)/2:100; sProp='width='+ w +',height='+ h +',top='+ t +',left='+ l +',scrollbars='+ sb +',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; }}
oWin=window.open(sUrl,'',sProp); oWin.focus(); }
var msSSTrans = new Array(75); msSSTrans[0] = "BasicImage(grayscale=0, xray=0, mirror=0, invert=0, opacity=1, rotation=0)"; msSSTrans[1] = "rnd"; msSSTrans[2] = "Barn(motion='out',orientation='vertical')"; msSSTrans[3] = "Barn(motion='out',orientation='horizontal')"; msSSTrans[4] = "Barn(motion='in',orientation='vertical')"; msSSTrans[5] = "Barn(motion='in',orientation='horizontal')"; msSSTrans[6] = "Blinds(Bands=2,direction='up')"; msSSTrans[7] = "Blinds(Bands=2,direction='down')"; msSSTrans[8] = "Blinds(Bands=2,direction='left')"; msSSTrans[9] = "Blinds(Bands=2,direction='right')"; msSSTrans[10] = "Blinds(Bands=15,direction='up')"; msSSTrans[11] = "Blinds(Bands=15,direction='down')"; msSSTrans[12] = "Blinds(Bands=15,direction='left')"; msSSTrans[13] = "Blinds(Bands=15,direction='right')"; msSSTrans[14] = "Checkerboard(Direction='up',SquaresX=4,SquaresY=4)"; msSSTrans[15] = "Checkerboard(Direction='down',SquaresX=4,SquaresY=4)"; msSSTrans[16] = "Checkerboard(Direction='left',SquaresX=4,SquaresY=4)"; msSSTrans[17] = "Checkerboard(Direction='right',SquaresX=4,SquaresY=4)"; msSSTrans[18] = "Checkerboard(Direction='up',SquaresX=50,SquaresY=12)"; msSSTrans[19] = "Checkerboard(Direction='down',SquaresX=50,SquaresY=12)"; msSSTrans[20] = "Checkerboard(Direction='left',SquaresX=50,SquaresY=12)"; msSSTrans[21] = "Checkerboard(Direction='right',SquaresX=50,SquaresY=12)"; msSSTrans[22] = "Fade(Overlap=1.00)"; msSSTrans[23] = "Fade(Overlap=0.00)"; msSSTrans[24] = "GradientWipe(GradientSize=0.00,wipestyle=0,motion='forward')"; msSSTrans[25] = "GradientWipe(GradientSize=0.00,wipestyle=0,motion='reverse')"; msSSTrans[26] = "GradientWipe(GradientSize=0.00,wipestyle=1,motion='forward')"; msSSTrans[27] = "GradientWipe(GradientSize=0.00,wipestyle=1,motion='reverse')"; msSSTrans[28] = "GradientWipe(GradientSize=0.75,wipestyle=0,motion='forward')"; msSSTrans[29] = "GradientWipe(GradientSize=0.75,wipestyle=0,motion='reverse')"; msSSTrans[30] = "GradientWipe(GradientSize=0.75,wipestyle=1,motion='forward')"; msSSTrans[31] = "GradientWipe(GradientSize=0.75,wipestyle=1,motion='reverse')"; msSSTrans[32] = "Iris(irisstyle='PLUS',motion='out')"; msSSTrans[33] = "Iris(irisstyle='PLUS',motion='in')"; msSSTrans[34] = "Iris(irisstyle='DIAMOND',motion='out')"; msSSTrans[35] = "Iris(irisstyle='DIAMOND',motion='in')"; msSSTrans[36] = "Iris(irisstyle='CIRCLE',motion='out')"; msSSTrans[37] = "Iris(irisstyle='CIRCLE',motion='in')"; msSSTrans[38] = "Iris(irisstyle='CROSS',motion='out')"; msSSTrans[39] = "Iris(irisstyle='CROSS',motion='in')"; msSSTrans[40] = "Iris(irisstyle='SQUARE',motion='out')"; msSSTrans[41] = "Iris(irisstyle='SQUARE',motion='in')"; msSSTrans[42] = "Iris(irisstyle='STAR',motion='out')"; msSSTrans[43] = "Iris(irisstyle='STAR',motion='in')"; msSSTrans[44] = "RadialWipe(wipestyle='CLOCK')"; msSSTrans[45] = "RadialWipe(wipestyle='WEDGE')"; msSSTrans[46] = "RadialWipe(wipestyle='RADIAL')"; msSSTrans[47] = "Wheel(spokes=2)"; msSSTrans[48] = "Wheel(spokes=4)"; msSSTrans[49] = "Wheel(spokes=10)"; msSSTrans[50] = "RandomBars(orientation='horizontal')"; msSSTrans[51] = "RandomBars(orientation='vertical')"; msSSTrans[52] = "RandomDissolve(duration=1)"; msSSTrans[53] = "Slide(slidestyle='HIDE',Bands=1)"; msSSTrans[54] = "Slide(slidestyle='SWAP',Bands=1)"; msSSTrans[55] = "Slide(slidestyle='PUSH',Bands=1)"; msSSTrans[56] = "Slide(slidestyle='HIDE',Bands=2)"; msSSTrans[57] = "Slide(slidestyle='SWAP',Bands=2)"; msSSTrans[58] = "Slide(slidestyle='PUSH',Bands=2)"; msSSTrans[59] = "Slide(slidestyle='HIDE',Bands=10)"; msSSTrans[60] = "Slide(slidestyle='SWAP',Bands=10)"; msSSTrans[61] = "Slide(slidestyle='PUSH',Bands=10)"; msSSTrans[62] = "Spiral(GridSizeX=8,GridSizeY=8)"; msSSTrans[63] = "Spiral(GridSizeX=16,GridSizeY=16)"; msSSTrans[64] = "Zigzag(GridSizeX=6,GridSizeY=6)"; msSSTrans[65] = "Zigzag(GridSizeX=12,GridSizeY=12)"; msSSTrans[66] = "Stretch(stretchstyle='HIDE')"; msSSTrans[67] = "Stretch(stretchstyle='PUSH')"; msSSTrans[68] = "Stretch(stretchstyle='SPIN')"; msSSTrans[69] = "Strips(motion='rightdown')"; msSSTrans[70] = "Strips(motion='leftdown')"; msSSTrans[71] = "Strips(motion='rightup')"; msSSTrans[72] = "Strips(motion='leftup')"; msSSTrans[73] = "Pixelate(MaxSquare=5)"; msSSTrans[74] = "Pixelate(MaxSquare=50)"; msSSTrans[75] = "Inset()"; var msMESSImage = new Array(); var miMESSEffect = new Array(); var miMESSDelay = new Array(); var miMESSCount = new Array(); var moMESSTime = new Array(); var moMESSTimeImg = new Array(); function imMESSPlay(iID,bMode,oImgData) {
msMESSImage[iID] = new Array(); miMESSEffect[iID] = new Array(); miMESSDelay[iID] = new Array(); for(i=0;i<oImgData.length;i++){
msMESSImage[iID][i+1] = "slideshow/"+oImgData[i][0]; miMESSEffect[iID][i+1] = oImgData[i][1]; miMESSDelay[iID][i+1] = oImgData[i][2]*1000; }
if(!miMESSCount[iID]) miMESSCount[iID]=0; imGetLayer("imMEObj_"+iID).innerHTML = "<div id=\"imMESSImage_"+iID+"\" style=\"width: 100%; height: 100%; z-index: 999;\"></div><div id=\"imMESSImage_"+iID+"_back\" style=\"width: 100%; height: 100%; z-index: 998;\"></div>"; imMESSDoAuto(iID,bMode); }
function imMESSDoAuto(iID,bMode) {
imMESSDoTrans(iID,bMode); iAutoDelay=miMESSDelay[iID][miMESSCount[iID]]; moMESSTime[iID]=setTimeout("imMESSDoAuto("+iID+","+bMode+")", iAutoDelay); }
function imMESSFade(iID) {
var div_Image=imGetLayer("imMESSImage_"+iID); var div_ImageBack=imGetLayer("imMESSImage_"+iID+"_back"); if(div_Image.style.opacity > 0)
div_Image.style.opacity -= 0.025; else {
clearInterval(moMESSTimeImg[iID]); div_Image.style.backgroundImage = div_ImageBack.style.backgroundImage; div_Image.style.opacity = 1; }}
function imMESSDoTrans(iID,bMode) {
iLast = msMESSImage[iID].length-1; miMESSCount[iID]=(bMode == 0 ? miMESSCount[iID]+1:Math.floor(Math.random()*msMESSImage[iID].length+1)); if (miMESSCount[iID] == iLast + 1) miMESSCount[iID] = 1; if (miMESSCount[iID] == 0) miMESSCount[iID] = iLast; var div_Main=imGetLayer("imMEObj_"+iID);  
var div_Image=imGetLayer("imMESSImage_"+iID); var div_ImageBack=imGetLayer("imMESSImage_"+iID+"_back"); if (imEffectEnabled) {
if (miMESSEffect[iID][miMESSCount[iID]] == 1)
  iSSEffectType = Math.floor(Math.random()*73) + 2; else
  iSSEffectType = miMESSEffect[iID][miMESSCount[iID]]; div_Main.style.filter="progid:DXImageTransform.Microsoft."+msSSTrans[iSSEffectType]; div_Main.filters.item(0).Apply(); }
if (imEffectEnabled) {
div_Image.style.backgroundImage = "url('')"; div_Image.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+msMESSImage[iID][miMESSCount[iID]]+"\", sizingMethod=\"scale\")"; }
else if(miMESSEffect[iID][miMESSCount[iID]] != 0){
div_ImageBack.style.backgroundImage = "url(" + msMESSImage[iID][miMESSCount[iID]] + ")"; moMESSTimeImg[iID] = setInterval('imMESSFade(' + iID + ')',10); }
else
div_Image.style.backgroundImage = "url(" + msMESSImage[iID][miMESSCount[iID]] + ")"; if (imEffectEnabled) div_Main.filters.item(0).Play(); iNext = miMESSCount[iID]+1
if (iNext <= iLast) {
oImg = new Image(); oImg.src = msMESSImage[iID][iNext]; }}
var miSSH = new Array(); var miSSW = new Array(); var msImgList = new Array(); var miImgW = new Array(); var miImgH = new Array(); var miSSDelay = new Array(); var miSSEffect = new Array(); var msSSDescr = new Array(); var msSSLink = new Array(); var miSSCount = new Array(); var moSSTime = new Array(); var moSSTimeImg = new Array(); var moSSTimeDescr = new Array(); var moSSTransTimer = new Array(); function imSSLoad(iID,oImgData) {
msImgList[iID] = new Array(); miImgW[iID] = new Array(); miImgH[iID] = new Array(); miSSEffect[iID] = new Array(); miSSDelay[iID] = new Array(); msSSDescr[iID] = new Array(); msSSLink[iID] = new Array(); moSSTransTimer[iID] = null; for(i=0;i<oImgData.length;i++){
msImgList[iID][i+1] = "slideshow/"+oImgData[i][0]; miImgW[iID][i+1] = oImgData[i][1]; miImgH[iID][i+1] = oImgData[i][2]; miSSDelay[iID][i+1] = oImgData[i][3]*1000; miSSEffect[iID][i+1] = oImgData[i][4]; msSSDescr[iID][i+1] = oImgData[i][5]; msSSLink[iID][i+1] = oImgData[i][6]; }
if(!miSSCount[iID]) miSSCount[iID]=1; if (!imEffectEnabled)
imGetLayer("imSSImage_"+iID+"_back").style.display = ''; }
function imSSFade(iID) {
var div_Image=imGetLayer("imSSImage_"+iID); var div_ImageBack=imGetLayer("imSSImage_"+iID+"_back"); if(div_Image.style.opacity > 0) {
div_Image.style.opacity -= 0.025; div_ImageBack.style.opacity = 1-div_Image.style.opacity; }
else {
clearInterval(moSSTimeImg[iID]); div_Image.src = div_ImageBack.src; div_Image.style.top = div_ImageBack.style.top; div_Image.style.left = div_ImageBack.style.left; div_Image.style.opacity = 1; div_ImageBack.style.opacity = 0; }}
function imSSDescrSlide(iID,direction) {
var div_Descr=imGetLayer("imSSDescr_"+iID); var pos = parseInt(div_Descr.style.bottom.substr(0,div_Descr.style.bottom.length-2)); if(pos > -div_Descr.clientHeight-10 && direction == 1) {
pos = (pos+(-div_Descr.clientHeight)/5); if(pos >= -div_Descr.clientHeight-10)
div_Descr.style.bottom = pos + 'px'; else
div_Descr.style.bottom = -div_Descr.clientHeight-10 + 'px'; }
else if(pos < 0 && direction == -1) {
pos = (pos-(-div_Descr.clientHeight)/5); if(pos <= 0)
div_Descr.style.bottom = pos + 'px'; else
div_Descr.style.bottom = '0px'; }
else
clearInterval(moSSTimeDescr[iID]); }
function imSSDescrHide(iID) {
clearInterval(moSSTimeDescr[iID]); moSSTimeDescr[iID] = setInterval('imSSDescrSlide(' + iID + ',1)',10); }
function imSSDescrShow(iID) {
clearInterval(moSSTimeDescr[iID]); moSSTimeDescr[iID] = setInterval('imSSDescrSlide(' + iID + ',-1)',10); }
function imDoTrans(iID,iStep) {
var div_SSBtns = imGetLayer("imSSBtns_"+iID); var div_SSBtnsImgs; iLast = msImgList[iID].length-1; if(moSSTransTimer[iID] != null) {
clearTimeout(moSSTransTimer[iID]); if(div_SSBtns) {
div_SSBtnsImgs = div_SSBtns.getElementsByTagName('img'); for(i = 0; i < div_SSBtnsImgs.length; i++)
if(div_SSBtnsImgs[i].className == 'imssBtn')
div_SSBtnsImgs[i].style.cursor = 'pointer'; }}
oImg = new Image(); iNext = miSSCount[iID]+iStep; if (iNext == iLast + 1) iNext = 1; if (iNext == 0) iNext = iLast; oImg.src = msImgList[iID][iNext]; if(oImg.complete) {
miSSCount[iID]=(miSSCount[iID]+iStep); if (miSSCount[iID] == iLast + 1) miSSCount[iID] = 1; if (miSSCount[iID] == 0) miSSCount[iID] = iLast; var div_Descr=imGetLayer("imSSDescr_"+iID); var div_DescrBG=imGetLayer("imSSDescr_"+iID+"_bg"); var div_DescrText=imGetLayer("imSSDescr_"+iID+"_text"); var div_Main=imGetLayer("imSSBackg_"+iID); var div_Images=imGetLayer("imSSImages_"+iID);  
var div_Image=imGetLayer("imSSImage_"+iID); var div_ImageBack=imGetLayer("imSSImage_"+iID+"_back"); if (imEffectEnabled) {
if (miSSEffect[iID][miSSCount[iID]] == 1)
  iSSEffectType = Math.floor(Math.random()*73) + 2; else
  iSSEffectType = miSSEffect[iID][miSSCount[iID]]; div_Images.style.filter="progid:DXImageTransform.Microsoft."+msSSTrans[iSSEffectType]; div_Images.filters.item(0).Apply(); div_Image.src = msImgList[iID][miSSCount[iID]]; iTop=parseInt((div_Main.clientHeight-miImgH[iID][miSSCount[iID]])/2); div_Image.style.top=iTop+'px'; div_Image.style.left=parseInt((div_Main.clientWidth-miImgW[iID][miSSCount[iID]])/2)+'px'; }
else if(iStep != 0 && miSSEffect[iID][miSSCount[iID]] != 0) {
div_ImageBack.src = msImgList[iID][miSSCount[iID]]; iTop=parseInt((div_Main.clientHeight-miImgH[iID][miSSCount[iID]])/2); div_ImageBack.style.top=iTop+'px'; div_ImageBack.style.left=parseInt((div_Main.clientWidth-miImgW[iID][miSSCount[iID]])/2)+'px'; clearInterval(moSSTimeImg[iID]); moSSTimeImg[iID]=setInterval("imSSFade("+iID+")", 10); }
else {
div_Image.style.visible = 'hidden'; div_Image.src = msImgList[iID][miSSCount[iID]]; iTop=parseInt((div_Main.clientHeight-miImgH[iID][miSSCount[iID]])/2); div_Image.style.top=iTop+'px'; div_Image.style.left=parseInt((div_Main.clientWidth-miImgW[iID][miSSCount[iID]])/2)+'px'; div_Image.style.visible = 'visible'; }
if(msSSDescr[iID][miSSCount[iID]] != '') {
div_DescrText.innerHTML = msSSDescr[iID][miSSCount[iID]]; div_Descr.style.display = ''; div_DescrBG.style.height = div_DescrText.clientHeight + 'px'; div_Descr.style.height = div_DescrText.clientHeight + 'px'; }
else
div_Descr.style.display = 'none'; if (imEffectEnabled) div_Images.filters.item(0).Play(); if(msSSLink[iID][miSSCount[iID]] != "#")
div_Image.style.cursor = 'pointer'; else
div_Image.style.cursor = 'default'; iNext = miSSCount[iID]+1
if (iNext <= iLast) {
oNextImg = new Image(); oNextImg.src = msImgList[iID][iNext]; }}
else {
moSSTransTimer[iID] = setTimeout('imDoTrans(' + iID + ',' + iStep + ')',10); if(div_SSBtns) {
div_SSBtnsImgs = div_SSBtns.getElementsByTagName('img'); for(i = 0; i < div_SSBtnsImgs.length; i++)
if(div_SSBtnsImgs[i].className == 'imssBtn')
div_SSBtnsImgs[i].style.cursor = 'wait'; }}
}
function imLink(iID){
if(msSSLink[iID][miSSCount[iID]] != "#")
location = msSSLink[iID][miSSCount[iID]]; }
function imDoAuto(iID) {
imDoTrans(iID,1); iAutoDelay=miSSDelay[iID][miSSCount[iID]]; moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay); }
function imSSPlay(iID,Auto,iBtnType) {
if (Auto == 1) {
imDoTrans(iID,0); miSSCount[iID]=1; iAutoDelay=miSSDelay[iID][miSSCount[iID]]; moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay); }
else {
cmd_Auto = imGetLayer('imssPlay_' + iID); if (cmd_Auto.alt == 'Pause') {
cmd_Auto.alt='Play'; cmd_Auto.src='res/ss_play'+iBtnType+'.gif'; clearTimeout(moSSTime[iID]); }
else {
cmd_Auto.alt='Pause'; cmd_Auto.src='res/ss_pause'+iBtnType+'.gif'; imDoTrans(iID, 1); iAutoDelay=miSSDelay[iID][miSSCount[iID]]; moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay); }}
}
var iMMCurPos=0; var iMMEnd = 0; var iMMEndDisplace = 0; var oMMTime = null; var imMMVel=0; var iMMHeaderSize = 0; var iMMFooterSize = 0; var iMMTimerInt = 0; function imGetOffset(sName) {return imGetLayer(sName).offsetHeight ?
imGetLayer(sName).offsetHeight :
imGetLayer(sName).style.pixelHeight ?
imGetLayer(sName).style.pixelHeight : 0; }
function imMMScrollMenu(){
if (document.documentElement && document.documentElement.scrollTop)
iMMEnd = document.documentElement.scrollTop > iMMHeaderSize ?
document.documentElement.scrollTop - iMMHeaderSize :
0; else if (document.body && document.body.scrollTop)
iMMEnd = document.body.scrollTop > iMMHeaderSize ?
document.body.scrollTop - iMMHeaderSize :
0; else
iMMEnd = 0; if(iMMCurPos > iMMEnd)
iMMEndDisplace = -(imMMVel-1);//up
else if (iMMCurPos < iMMEnd)
iMMEndDisplace = (imMMVel-1);//down
iMMCurPos += ((iMMEnd - iMMCurPos + iMMEndDisplace)/imMMVel); iMMCurPos = parseInt(iMMCurPos); imGetLayer("imMnMn").style.paddingTop = iMMCurPos + 'px'; if (iMMCurPos == iMMEnd){
clearTimeout(oMMTime); oMMTime = null; }
else{
clearTimeout(oMMTime); oMMTime = setTimeout("imMMScrollMenu()", iMMTimerInt); }}
function imMMMenu(){
if(!oMMTime)
oMMTime = setTimeout("imMMScrollMenu()", iMMTimerInt); }
function imMMInit(iMMVel){
iMMHeaderSize = imGetLayer("imMenuMain").offsetTop; iMMFooterSize = imGetLayer("imFooter").offsetTop; imMMVel = iMMVel; iTimerInt = 5; iMMCurPos = 0; imGetLayer("imMnMn").style.paddingTop = iMMCurPos + 'px'; window.onscroll = imMMMenu; }
var imShowBoxTimer = null; var imShowBoxBGFadeTimer = null; var imShowBoxStep = 0; var imShowBoxBGOpacity = 0; var imShowBoxOpacity = 0; var imShowBoxContentOpacity = 0; var imShowBoxHeight = 200; var imShowBoxDimensionsStep = 0; var imShowBoxDescriptionDimensionsStep = 0; var imShowBoxContentHTML; var imShowBoxReady = 1; var imShowBoxEffect = 'f'; function IMShowBoxImagePreloader(src) {
this.src = src; var imgPreloader = new Image; imgPreloader.imImgID = this.id; imgPreloader.onload = function() {
imShowBoxReady = 1; }; imgPreloader.src = src; }; function imShowBox(content,height,width,description,type,effect) {
if (!imPopupEffect && effect != 'f') effect = 'f'; var imsbbg = imGetLayer('imShowBoxBG'); var imsbc = imGetLayer('imShowBoxContainer'); var imsb = imGetLayer('imShowBox'); var top = 50; switch(type) {
case 'IMG':
imShowBoxContentHTML = "<img id=\"imShowBoxImage\" src=\"" + content + "\" width=\"" + width + "\" height=\"" + height + "\" />"; imShowBoxReady = 0; new IMShowBoxImagePreloader(content); break; case 'SWF':
imShowBoxContentHTML = "<embed src=\"" + content + "\" type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\" wmode=\"opaque\" menu=\"false\" quality=\"high\"></embed>"; break; case 'VIDEO':
imShowBoxContentHTML = "<embed src=\"" + content + "\" width=\""+width+"\" height=\""+height+"\" autostart=\"true\"></embed>"; break; case 'IFRAME':
imShowBoxContentHTML = "<iframe src=\"" + content + "\" width=\"" + width + "\" height=\"" + height + "\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\"></iframe>"; break; case 'CODE':
imShowBoxContentHTML = content; break; }
imShowBoxContentHTML = "<div id=\"imShowBoxContent\">" + imShowBoxContentHTML + "</div><div id=\"imShowBoxDescription\">" + description + "</div>"; imsbbg.style.display = ''; imShowBoxBGFadeTimer = setInterval('imShowBoxBGFade(1)',2); if ((document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop))
top += (document.documentElement.scrollTop > document.body.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ); imShowBoxEffect = effect; if(effect == 't') {
imsbc.style.top = -(imsb.style.height.substr(0,imsb.style.height.length-2)+30) + 'px'; imsb.style.opacity = 1; imsb.style.filter = 'alpha(opacity=100)'; imsbc.style.display = ''; imShowBoxTimer = setInterval('imShowBoxTraslate(' + top + ',' + width + ',' + height + ',1)',30); }
else {
imsbc.style.top = top + 'px'; imsb.style.opacity = 0; imsb.style.filter = 'alpha(opacity=0)'; imsbc.style.display = ''; imShowBoxTimer = setInterval('imShowBoxFade(' + width + ',' + height + ',1)',30); }}
function imShowBoxHide() {
if(imShowBoxTimer != null)
clearInterval(imShowBoxTimer); var imsbc = imGetLayer('imShowBoxContent'); var top = 50; if ((document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop))
top += (document.documentElement.scrollTop > document.body.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ); if(imShowBoxEffect == 't')
imShowBoxTimer = setInterval('imShowBoxTraslate(' + top + ',0,0,-1)',30); else
imShowBoxTimer = setInterval('imShowBoxFade(0,0,-1)',30); imShowBoxContentOpacity = 0; if(imShowBoxBGFadeTimer != null)
clearInterval(imShowBoxBGFadeTimer); imShowBoxBGFadeTimer = setInterval('imShowBoxBGFade(-1)',2); }
function imShowBoxTraslate(top,width,height,direction) {
var imsbc = imGetLayer('imShowBoxContainer'); var imsb = imGetLayer('imShowBox'); var imsbct = imGetLayer('imShowBoxContent'); var pos = parseInt(imsbc.style.top.substr(0,imsbc.style.top.length-2)); if(imShowBoxStep < 5)
imsbc.style.top = top-(imShowBoxHeight*2-imShowBoxHeight*imShowBoxStep/10)*Math.cos(imShowBoxStep/10*Math.PI) + 'px'; else
imsbc.style.top = top-15*Math.cos(imShowBoxStep/10*Math.PI) + 'px'; if(direction == 1) {
if(imShowBoxStep == 15) {
clearInterval(imShowBoxTimer); imShowBoxTimer = setInterval('imShowBoxDimensions(' + width + ',' + height + ')',10); }
else
if(imShowBoxStep < 5)
imShowBoxStep++; else
imShowBoxStep+=2; }
else {
if(imShowBoxStep == 0) {
var imsbct = imGetLayer('imShowBoxContent'); clearInterval(imShowBoxTimer); imsbc.style.display = 'none'; if(imsbct) {
imsbct.style.opacity = 0; imsbct.style.filter = 'alpha(opacity=0)'; }
imsb.innerHTML = ''; }
else
if(imShowBoxStep < 5)
imShowBoxStep--; else
imShowBoxStep-=2; }}
function imShowBoxBGFade(direction) {
var imsbbg = imGetLayer('imShowBoxBG'); imShowBoxBGOpacity+=direction; imsbbg.style.opacity = imShowBoxBGOpacity/5; imsbbg.style.filter = 'alpha(opacity=' + imShowBoxBGOpacity/0.05 + ')'; if(imShowBoxBGOpacity == 4 && direction == 1)
clearInterval(imShowBoxBGFadeTimer); if(imShowBoxBGOpacity == 0 && direction == -1) {
clearInterval(imShowBoxBGFadeTimer); imsbbg.style.display = 'none'; }}
function imShowBoxFade(width,height,direction) {
var imsbc = imGetLayer('imShowBoxContainer'); var imsb = imGetLayer('imShowBox'); var imsbct = imGetLayer('imShowBoxContent'); if(imShowBoxOpacity == 0 && direction == 1) {
imShowBoxHeight = height; imsb.style.height = height + 'px'; imShowBoxWidth = width; imsb.style.width = width + 'px'; }
imShowBoxOpacity+=direction; imsb.style.opacity = imShowBoxOpacity/10; imsb.style.filter = 'alpha(opacity=' + imShowBoxOpacity/0.1 + ')'; if(imShowBoxOpacity == 10 && direction == 1) {
clearInterval(imShowBoxTimer); imShowBoxSetContent(); }
if(imShowBoxOpacity == 0 && direction == -1) {
clearInterval(imShowBoxTimer); imsbc.style.display = 'none'; if(imsbct) {
imsbct.style.opacity = 0; imsbct.style.filter = 'alpha(opacity=0)'; }
imsb.innerHTML = ''; }}
function imShowBoxContentFade() {
if(imShowBoxReady == 1) {
var imsbc = imGetLayer('imShowBoxContent'); imShowBoxContentOpacity+=1; imsbc.style.opacity = imShowBoxContentOpacity/10; imsbc.style.filter = 'alpha(opacity=' + imShowBoxContentOpacity/0.1 + ')'; if(imShowBoxContentOpacity == 10) {
clearInterval(imShowBoxContentFadeTimer); var imsbd = imGetLayer('imShowBoxDescription'); if(imsbd.innerHTML != '')
imShowBoxTimer = setInterval('imShowBoxDescriptionDimensions(' + (imShowBoxHeight+imsbd.offsetHeight) + ')',5); }}
}
function imShowBoxDimensions(width,height) {
var imsb = imGetLayer('imShowBox'); if(imShowBoxDimensionsStep < 20) {
if(height != imShowBoxHeight) {
imShowBoxHeight += (height-imShowBoxHeight)/(20-imShowBoxDimensionsStep); imsb.style.height = imShowBoxHeight + 'px'; imShowBoxDimensionsStep++; }
else
imShowBoxDimensionsStep = 20; }
else if(imShowBoxDimensionsStep < 40) {
var imsbw = parseInt(imsb.style.width.substr(0,imsb.style.width.length-2)); if(imsbw != width) {
imsbw += (width-imsbw)/(40-imShowBoxDimensionsStep); imsb.style.width = imsbw + 'px'; imShowBoxDimensionsStep++; }
else
imShowBoxDimensionsStep = 40; }
else {
clearInterval(imShowBoxTimer); imShowBoxSetContent(); imShowBoxDimensionsStep = 0; }}
function imShowBoxDescriptionDimensions(height) {
var imsb = imGetLayer('imShowBox'); if(imShowBoxDescriptionDimensionsStep < 10) {
imShowBoxHeight += (height-imShowBoxHeight)/(10-imShowBoxDescriptionDimensionsStep); imsb.style.height = imShowBoxHeight + 'px'; imShowBoxDescriptionDimensionsStep++; }
else {
clearInterval(imShowBoxTimer); imShowBoxDescriptionDimensionsStep = 0; }}
function imShowBoxSetContent() {
var imsb = imGetLayer('imShowBox'); imsb.innerHTML = imShowBoxContentHTML; imShowBoxContentFadeTimer = setInterval('imShowBoxContentFade()',20); }
var moFGTime = null; var moFGTimeDescr = new Array(); var moFGTimeImg = new Array(); var moFGTimeNextImg = new Array(); var mFGMoving = new Array(); function imFGClickLR(iFGIndex,iFGBkSize,iFGEndBlock,iFGMaxBlock,iFGSpeed,iFGDir){
var oFGObj = imGetLayer("imFGImgList_" + iFGIndex); var imiLeft = parseInt(oFGObj.style.left); iFGEndBlock = iFGEndBlock <= iFGMaxBlock ? iFGEndBlock < 0 ? 0 : iFGEndBlock : iFGMaxBlock; if(Math.abs(imiLeft) == iFGEndBlock*iFGBkSize){
mFGMoving[iFGIndex] = null; return; }
if(mFGMoving[iFGIndex] && mFGMoving[iFGIndex] != iFGDir)
return; else
mFGMoving[iFGIndex] = iFGDir; if(Math.abs(imiLeft) < iFGEndBlock*iFGBkSize && iFGDir==1){
if(Math.abs(imiLeft - iFGSpeed) > iFGEndBlock*iFGBkSize )
iFGSpeed = imiLeft+iFGEndBlock*iFGBkSize; oFGObj.style.left = imiLeft - iFGSpeed + "px"; setTimeout("imFGClickLR(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40); }
else if(Math.abs(imiLeft) > iFGEndBlock*iFGBkSize && imiLeft <= 0 && iFGDir==2){
if(Math.abs(imiLeft + iFGSpeed) < iFGEndBlock*iFGBkSize || (imiLeft + iFGSpeed) > iFGEndBlock*iFGBkSize)
iFGSpeed = Math.abs(imiLeft)-iFGEndBlock*iFGBkSize; oFGObj.style.left = imiLeft + iFGSpeed + "px"; setTimeout("imFGClickLR(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40); }}
function imFGClickUD(iFGIndex,iFGBkSize,iFGEndBlock,iFGMaxBlock,iFGSpeed,iFGDir){
var oFGObj = imGetLayer("imFGImgList_" + iFGIndex); var imiTop = parseInt(oFGObj.style.top); iFGEndBlock = iFGEndBlock <= iFGMaxBlock ? iFGEndBlock < 0 ? 0 : iFGEndBlock : iFGMaxBlock; if(Math.abs(imiTop) == iFGEndBlock*iFGBkSize){
mFGMoving[iFGIndex] = null; return; }
if(mFGMoving[iFGIndex] && mFGMoving[iFGIndex] != iFGDir)
return; else
mFGMoving[iFGIndex] = iFGDir; if(Math.abs(imiTop) < iFGEndBlock*iFGBkSize && iFGDir==2){
if(Math.abs(imiTop - iFGSpeed) > iFGEndBlock*iFGBkSize )
iFGSpeed = parseInt((imiTop+iFGEndBlock*iFGBkSize)); oFGObj.style.top = imiTop - iFGSpeed + "px"; setTimeout("imFGClickUD(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40); }
else if(Math.abs(imiTop) > iFGEndBlock*iFGBkSize && imiTop <= 0 && iFGDir==1){
if(Math.abs(imiTop + iFGSpeed) < iFGEndBlock*iFGBkSize || (imiTop + iFGSpeed) > iFGEndBlock*iFGBkSize)
iFGSpeed = parseInt((Math.abs(imiTop)-iFGEndBlock*iFGBkSize)); oFGObj.style.top = imiTop + iFGSpeed + "px"; setTimeout("imFGClickUD(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40); }}
function imFGMove(iFGIndex,iFGSpeed,iFGType,iFGCmd){
clearTimeout(moFGTime); if(iFGType < 1 || iFGType > 4)
 return; var imDataObj = imGetLayer("imFGImgList_" + iFGIndex); var imDataCont = imGetLayer("imFGImgCont_" + iFGIndex); var imiLeft = parseInt(imDataObj.style.left); var imiTop = parseInt(imDataObj.style.top); var imiSize = imGetLayer("imFGItem_" + iFGIndex + "_" + 1 ).offsetHeight; var imiTWBlock = parseInt(imDataObj.offsetWidth/imiSize); var imiTHBlock = parseInt(imDataObj.offsetHeight/imiSize); switch(iFGType){
  //move right
case 1:{
  if (imiLeft - iFGSpeed >= imDataCont.offsetWidth - imDataObj.offsetWidth)
       switch(iFGCmd){
case 0:
if(mFGMoving[iFGIndex])
return;   imDataObj.style.left = imiLeft - iFGSpeed + "px";   break;   //move 1 image
  case 1:
imFGClickLR(iFGIndex,imiSize,parseInt(Math.abs(imiLeft/imiSize)+1),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,1); return;   default:
imFGClickLR(iFGIndex,imiSize,
parseInt(Math.abs(imiLeft/imiSize)+parseInt(imDataCont.offsetWidth/imiSize)),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,
1); return; }
break; }
case 2 :{
if (imiLeft + iFGSpeed < 0)
  switch(iFGCmd){
    //continuous movement
case 0:
if(mFGMoving[iFGIndex])
return;       imDataObj.style.left = imiLeft + iFGSpeed + "px";       break;     //move unitl next image
  case 1 :
imFGClickLR(iFGIndex,imiSize,parseInt(Math.abs(imiLeft/imiSize)),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,2); return; default:
imFGClickLR(iFGIndex,imiSize,
parseInt(Math.abs(imiLeft/imiSize)-parseInt(imDataCont.offsetWidth/imiSize)),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,
2); return; }
else
imDataObj.style.left = 0;   break; }
case 3 :{
if (imiTop + iFGSpeed < 0)
switch(iFGCmd){
        //continuous movement
        case 0 :
          if(mFGMoving[iFGIndex])
return; imDataObj.style.top = imiTop + iFGSpeed + "px"; break; case 1 :
imFGClickUD(iFGIndex,imiSize,parseInt(Math.abs(imiTop/imiSize)),
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,1); return; default :
imFGClickUD(iFGIndex,imiSize,
parseInt(Math.abs(imiTop/imiSize)-parseInt(imDataCont.offsetHeight/imiSize)),
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,
1);       return; }
else{
  imDataObj.style.top = 0;   return; }
break; }
case 4 :{
if (imiTop - iFGSpeed >= imDataCont.offsetHeight - imDataObj.offsetHeight)
switch(iFGCmd){
      //continuous movement
case 0 :
if(mFGMoving[iFGIndex])
return; imDataObj.style.top = imiTop - iFGSpeed + "px"; break; case 1 :
imFGClickUD(iFGIndex,imiSize,parseInt(Math.abs(imiTop/imiSize))+1,
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,2); return; default:
imFGClickUD(iFGIndex,imiSize,
parseInt(Math.abs(imiTop/imiSize)+parseInt(imDataCont.offsetHeight/imiSize))+1,
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,
2);     return; }
  }
 }
moFGTime = setTimeout("imFGMove(" + iFGIndex + "," + iFGSpeed + "," + iFGType + "," + iFGCmd + ")", 50); }
function imFGFade(iID) {
var div_Image=imGetLayer("imFGImage_"+iID); var div_ImageBack=imGetLayer("imFGImage_"+iID+"_back"); if(div_Image.style.opacity > 0) {
div_Image.style.opacity -= 0.025; div_ImageBack.style.opacity = 1-div_Image.style.opacity; }
else {
clearInterval(moFGTimeImg[iID]); div_Image.src = div_ImageBack.src; div_Image.style.top = div_ImageBack.style.top; div_Image.style.left = div_ImageBack.style.left; div_Image.style.opacity = 1; div_ImageBack.style.opacity = 0; }}
function imFGShow(iIndex,sImageSrc,iImageH,iImageW,sDescr,sLink,iEffect){
if(moFGTimeNextImg[iIndex] != undefined)
clearTimeout(moFGTimeNextImg[iIndex]); oImg = new Image(); oImg.src = 'imagebrowser/' + sImageSrc; if(oImg.complete) {
var div_FGMain = imGetLayer("imFGMain_" + iIndex); var div_FGImageCont = imGetLayer("imFGImage_" + iIndex + "_cont"); var div_FGImage = imGetLayer("imFGImage_" + iIndex); var div_FGImageBack = imGetLayer("imFGImage_" + iIndex + "_back"); var div_FGDescr = imGetLayer("imFGDescr_" + iIndex); var div_FGDescrText = imGetLayer("imFGDescr_" + iIndex + "_text"); var div_FGDescrBG = imGetLayer("imFGDescr_" + iIndex + "_bg"); if (imEffectEnabled && iEffect != 0) {
if (iEffect == 1) iEffect = Math.floor(Math.random()*73) + 2; div_FGImageCont.style.filter="progid:DXImageTransform.Microsoft."+msSSTrans[iEffect]; div_FGImageCont.filters.item(0).Apply(); }
var iTop = parseInt((div_FGMain.offsetHeight-iImageH)/2); var iLeft = parseInt((div_FGMain.offsetWidth-iImageW)/2); if(sDescr != '') {
div_FGDescrText.innerHTML = sDescr; div_FGDescr.style.display = ''; div_FGDescrBG.style.height = div_FGDescrText.clientHeight + 'px'; div_FGDescr.style.height = (div_FGDescrText.clientHeight) + 'px'; div_FGDescrBG.style.filter = 'alpha(opacity=60)'; }
else {
div_FGDescr.style.display = 'none'; }
if(div_FGImage.style.display == 'none')
div_FGImage.style.display = ''; if(iEffect != 0 && !imEffectEnabled) {
div_FGImageBack.src = 'imagebrowser/' + sImageSrc; div_FGImageBack.style.top = iTop + 'px'; div_FGImageBack.style.left = iLeft + 'px'; div_FGImageBack.style.display = ''; clearInterval(moFGTimeImg[iIndex]); moFGTimeImg[iIndex]=setInterval("imFGFade("+iIndex+")", 10); }
else {
div_FGImage.style.visible = 'hidden'; div_FGImage.src = 'imagebrowser/' + sImageSrc; div_FGImage.style.top = iTop + 'px'; div_FGImage.style.left = iLeft + 'px'; div_FGImage.style.visible = 'visible'; }
if (sLink!="#") {
 div_FGMain.onclick= function onclick(event) {location = sLink};   div_FGMain.style.cursor="pointer"; } else {
    div_FGMain.onclick="";  div_FGMain.style.cursor="default"; }
if (imEffectEnabled && iEffect != 0) div_FGImageCont.filters.item(0).Play(); }
else
moFGTimeNextImg[iIndex] = setTimeout('imFGShow(' + iIndex + ',\'' + sImageSrc + '\',' + iImageH + ',' + iImageW + ',\'' + sDescr + '\',\'' + sLink.split('\'').join('\\\'') + '\',' + iEffect + ')',10); }
function imFGDescrSlide(iID,direction) {
var div_Descr=imGetLayer("imFGDescr_" + iID); var pos = parseInt(div_Descr.style.bottom.substr(0,div_Descr.style.bottom.length-2)); if(pos > -div_Descr.clientHeight-10 && direction == 1) {
pos = (pos+(-div_Descr.clientHeight)/5); if(pos >= -div_Descr.clientHeight-10)
div_Descr.style.bottom = pos + 'px'; else
div_Descr.style.bottom = -div_Descr.clientHeight-10 + 'px'; }
else if(pos < 0 && direction == -1) {
pos = (pos-(-div_Descr.clientHeight)/5); if(pos <= 0)
div_Descr.style.bottom = pos + 'px'; else
div_Descr.style.bottom = '0px'; }
else
clearInterval(moFGTimeDescr[iID]); }
function imFGDescrHide(iID) {
clearInterval(moFGTimeDescr[iID]); moFGTimeDescr[iID] = setInterval('imFGDescrSlide(' + iID + ',1)',10); }
function imFGDescrShow(iID) {
clearInterval(moFGTimeDescr[iID]); moFGTimeDescr[iID] = setInterval('imFGDescrSlide(' + iID + ',-1)',10); }
function imMapSwap(oLI) {
if(oLI.className == 'imMap_closed')
oLI.className = 'imMap_open'; else
oLI.className = 'imMap_closed'; }
function imMapExpAll() {
var a = document.getElementsByTagName('li'); for(var i = 0; i < a.length; i++)
if(a[i].className == 'imMap_closed')
a[i].className = 'imMap_open'; }
function imMapCmpAll() {
var a = document.getElementsByTagName('li'); for(var i = 0; i < a.length; i++)
if(a[i].className == 'imMap_open')
a[i].className = 'imMap_closed'; }
function imSwapImg(oDiv, sImgName) {
if (sImgName != "")
oDiv.style.backgroundImage = "url(" + sImgName + ")"; else
oDiv.style.backgroundImage = ""; }
window.onload = function() {
eval(imLoadList); }

function waitLoading() {
var overlay = document.getElementById('hidepage');
var pageSize = getPageSize();
overlay.style.width=pageSize[0]+'px';
overlay.style.height=pageSize[1]+'px';
var img = document.images[document.images.length-2];
if (img.complete) {
	if (document.getElementById) {  // DOM3 = IE5, NS6
		overlay.style.visibility = 'hidden';
	}
	else {
		if (document.layers) {  // Netscape 4
			document.hidepage.visibility = 'hidden';
		}	else {  // IE 4
			document.all.hidepage.style.visibility = 'hidden';
		  }
	   }
} else {
	var i = setTimeout('waitLoading()', 1000);
 }
}
