

// - - - - - Javascript includes/js.php/functions.js.php included

// dynamic html routines

function onLoad()
{
	loading = false;
}

pageloading = false;
function init()
	{
	initlayers();
	for(m=1;m<5;m++)
		{
		divinit = eval("window.menu" + m); 
		divinit.onmouseover = showmenu2;
		divinit.onmouseout = hidemenu2;
		divinit.clipto = 10;
		divinit.setclipbottom(divinit.getheight());
		}
	if(!ismac) loop = setInterval("anim();",50);
        // was causing NN4 error:
	//setTimeout("menutoplink.show()",100); 
	pageloading = true;
	}

	
function anim()
	{
	for(m=1;m<5;m++)
		{
		divanim = eval("menu" + m);
		botzone = divanim.clipto - divanim.getclipbottom();

		if(botzone)
			{
			divanim.setclipbottom(Math.floor(divanim.getclipbottom()+(botzone/1.2)));
			}
		else
			{
			divanim.hide();
			}
		}
	}

function hidemenu2()
	{
	if(ismac) this.hide();
	else this.clipto = 19;
	}

function showmenu2()
	{
	if(ismac) this.show();
	else this.clipto = this.getheight();
	}
	
function showmenu(id)
	{
        var showmenudiv = eval('window.'+id);
	showmenudiv.show();
	showmenudiv.clipto = showmenudiv.getheight();
	}
	
function hidemenu(id)
	{
	var hidemenu = eval('window.'+id)
	if(ismac) hidemenu.hide();
	else hidemenu.clipto = 19;
	}

// Fix for Netscape (doesnt work for 4.08)

function fix()
	{
	bVer='';
	bName = navigator.appName.toLowerCase();
    bVer=navigator.appVersion.substring(0,3);
	
    if(bName == "netscape" && bVer>= '4.08')
		{
		document.location = document.location
		}
	}	

var debut, fin, langid, lastid

// fonction qui permet de passer a la page equivalente dans une autre langue 

function changelangue(langid,lastid)
	{
	var template = document.location.href;
	debut  =  template.slice(0,template.lastIndexOf(lastid));
	debut  += langid;
	fin    =  template.slice((template.lastIndexOf(lastid) + 4),template.length);
	document.location.href = (debut + fin);
	} 

// fonction pour changer les images des sous sous section 
function rollover(nameid) { document['igs' + nameid].src = "/images/li_l3_on.gif" }
function rollout(nameid) { document['igs' + nameid].src = "/images/li_l3_off.gif" }

// fonction open window pour la sous-section "notre flotte"
function openWin(url,w,h,s)
{
window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=' + s + ',resizable=0,width=' + w + ',height=' + h + ',top=20,left=20')
}

function open_window(url,w,h)
{
window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,width=' + w + ',height=' + h + ',top=20,left=20')
}

function open_map(url,w,h)
{
window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + w + ',height=' + h + ',top=20,left=20')
}

function xmltarget(url)
	{
//	window.open(url,"fromxml",toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=1,'width=' + windowwidth-20 + ',height=' + windowheight + ',top=20,left=20')
	window.open(url,"fromxml",'width='+eval(windowwidth-100)+', height='+windowheight+',toolbar=1,location=1,directories=1,status=1,menubar=1,resizable=1,top=20,left=20')
	}

// Pop windows pour les produits

// Screen Postion
function position(object,h,y,e)
	{
	if(isns4)
		{
		if ((e.y + h) > (window.pageYOffset + window.innerHeight))
			{
			y = ((window.innerHeight - h) + window.pageYOffset - 4)
			}
		else
			{
			y = y - 4
			}
		}
		
	else if(isie)
		{
		e = window.event;
		if ((e.y+document.body.scrollTop+h) > (document.body.scrollTop + document.body.clientHeight))
			{
		    y = ((document.body.clientHeight - h) + document.body.scrollTop - 4)
			}
	    else
			{
			y = y - 4 
			}
		}
		
	object.setxy(170,y);		
	}

	
// Coordonate and html write
function zoom(id,width,heigh,state,e)
	{
	if(pageloading)
		{
		if(isie)
			{
			x = window.event.x+document.body.scrollLeft;
			y = window.event.y+document.body.scrollTop-20;
			}
		else
			{
			x = e.pageX;
			y = e.pageY-25;
			}
		
		product.html("<table bgcolor=6699FF cellpadding=1 cellspacing=0 border=0><tr><td><img src='../images/prod/" + id + ".jpg' onLoad='zoomshow()' height=" + heigh + " width=" + width + "></td></tr></table>\n");
		zoomanim.html("<table bgcolor='6699FF' cellpadding='1' cellspacing='0' border='0'><tr><td><table width=" + width + " height=" + heigh + " cellpadding=0 cellspacing=1 border=0 bgcolor=ffffff><tr><td valign=middle align=center><img src=\"../images/loading.gif\" width=46 height=6 border=0></td></tr></table></td></tr></table>\n");
		position(zoomanim,heigh,y,e);
		position(product,heigh,y,e);
		zoomanim.show();
		product.show();
		}
	}

function zoomout(id,state,e)
	{
	if(pageloading)
		{
		zoomanim.hide();
		product.hide();	
		}
	}
	
function zoomshow()
	{
	zoomanim.hide();
	product.show();	
	}

function newWindowResizable(file,window,w,h) 
	{
    	open(file,window,'width='+w+',height='+h+',left='+((screen.width-10-w)/2)+',top='+
	((screen.height-29-h)/2)+
	',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');
	}

function OpenSolutionFinder()
	{
	newWindowResizable('solutionfinder.html','SOLUTION',624,433);
	}

function OpenImageDirector()
	{
	newWindowResizable('http://www.imagedirector.net','ImageDirector',800,600);
	}

function OpenImaHost()
	{
	newWindowResizable('http://www.imahost.net','ImaHost',800,600);
	}

// - - - - - Javascript includes/js.php/general.js.php included

// 2003 (c) Onison Canada Corporation - Taggon CMS
// Version 1.0.0
// ==========================

// Onison Canada Corporation
// 2610 - 555 West Hastings Street
// Vancouver, BC  V6B 4N5
// Canada

// phone : 604-601-2593
// email : taggon@onison.com
// web   : http://www.onison.com

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Taggon-Key
AllowEditArticle = 'true';
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



var company = "abb" ;
var tUserID = "2" ;
var tUser = "" ;
var tPass = "" ;
var tImgDirUrl = 'http://'+company+'.imagedirector.net/' ;
function imagePopupWindow(ImageID, company, imgWidth, imgHeight, SName, Title)
{
    if (window.top.frames["toolbar"]) {
        return false;
    }

    if (SName == "na" || SName == "doc" || SName == "jpg" ) {
        //var imgHtml = '<img src="http://' + company + '.imagedirector.net/' + company + '/generated/' + ImageID + '-p" style="width:' + imgWidth + ';height:' + imgHeight + ';">';
        // raymond@20040729 : remove the width and height style, the change to -p version instead of -s, but the imagedirector is still passing the -s version of width and height
        var imgHtml = '<img src="http://' + company + '.imagedirector.net/' + company + '/generated/' + ImageID + '-p">';
    } else if (SName == "media-qt") {
        var imgHtml = '';
        var fileSrc = 'http://' + company + '.imagedirector.net/temp/AudioVideo/' + (ImageID.indexOf('.mov')!=-1 ? ImageID : ImageID + '.mov');

        imgHtml += '<object ID="mediaPlayer" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" standby="Loading components..." width="100%" height="100%">';
        imgHtml += '<param name="src" value="' + fileSrc + '">';
        imgHtml += '<param name="controller" value="false">';
        imgHtml += '<param name="autoplay" value="true">';
        imgHtml += '<param name="bgcolor" value="#FFFFFF">';
        imgHtml += '<embed pluginspage="http://www.apple.com/quicktime/download/" src="' + fileSrc + '" width="160" height="144" autoplay="true" controller="false"></embed>';
        imgHtml += '</object>';
    } else if (SName == "media-wm") {
        var imgHtml = '';
        var fileSrc = 'http://' + company + '.imagedirector.net/temp/AudioVideo/' + (ImageID.indexOf('.wmv') != -1 ? ImageID : ImageID + '.wmv');

        imgHtml += '<object ID="mediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading components..." type="application/x-oleobject">';
        imgHtml += '<param name="fileName" value="' + fileSrc + '">';
        imgHtml += '<param name="animationatStart" value="true">';
        imgHtml += '<param name="transparentatStart" value="true">';
        imgHtml += '<param name="autoStart" value="true">';
        imgHtml += '<param name="showControls" value="true">';
        imgHtml += '<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="' + fileSrc + '" name="MediaPlayer1" showcontrols="1" width="360" height="300" autostart="true" enablecontextmenu="1" showstatusbar="1"></embed>';
        imgHtml += '</object>';
    } else {
        var imgHtml = '<img src="http://' + company + '.imagedirector.net/' + company + '/original_images/' + SName + '" style="">';
    }

    var popupWidth = parseInt(imgWidth) + 70;
    var popupHeight = parseInt(imgHeight) + 80;

    var imagePopupWindow = window.open('','imgWin','resizable=1,HEIGHT=302,WIDTH=328'); //width=' + popupWidth +',height=' + popupHeight);

    var imagePopupWindowHtml = '';

    imagePopupWindowHtml += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
    imagePopupWindowHtml += '<html>';
    imagePopupWindowHtml += '<head>';
    imagePopupWindowHtml += '    <title>' + Title + '</title>';
    imagePopupWindowHtml += '    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';
    imagePopupWindowHtml += '</head>';
    imagePopupWindowHtml += '<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">';
    imagePopupWindowHtml += '<DIV ALIGN="center">' + imgHtml + '</DIV>';
    //imagePopupWindowHtml += '<DIV ALIGN="right">';
    //imagePopupWindowHtml += '  <A HREF="javascript:self.close()" style="font-family:arial;color:#000000;font-weight:bold;font-size:12px;">Close</A>&nbsp;&nbsp;&nbsp;<BR><BR>';
    //imagePopupWindowHtml += '</DIV>';
    imagePopupWindowHtml += '</body>';
    imagePopupWindowHtml += '</html>';

    var imagePopup = imagePopupWindow.document;

    imagePopup.write(imagePopupWindowHtml);
    imagePopup.close();
    //imagePopupWindow.history.go(0);

    if(imagePopupWindow.document.images[0])
    {
        /*
        //alert( 'imagePopupWindow("' +ImageID+'", "' + company+'", "' + imgWidth+'", "' + imgHeight+'", "' + SName+'", "' + Title+'")' );
        if( ! imagePopupWindow.document.images[0].complete ) {
            TimerId = imagePopupWindow.setTimeout('imagePopupWindow("' +ImageID+'", "' + company+'", "' + imgWidth+'", "' + imgHeight+'", "' + SName+'", "' + Title+'")', 400);
         } else {
            if( TimerId ) imagePopupWindow.clearTimeout( TimerId );
        }
        */
        today = new Date ;
        timeout = 30 * 1000 ; //ms
        start = today.getTime();
        //alert( start );
        while( ! imagePopupWindow.document.images[0].complete || (today.getTime()-start) > timeout );
        
         var newImage = document.createElement('img');
         newImage.setAttribute('src', imagePopupWindow.document.images[0].src);
         imagePopupWindow.document.images[0].style.width = newImage.width;
         imagePopupWindow.document.images[0].style.height = newImage.height;
         imagePopupWindow.resizeTo(newImage.width + 30,newImage.height + 30);
         //self.focus();
         //alert(newImage.width+" x "+ newImage.height);
    } else if (SName == "media-qt" || SName == "media-wm") {
         imagePopupWindow.resizeTo(popupWidth, popupHeight);
	}
		

    imagePopupWindow.focus();

}


function imageDowloadPopup(ImageID,imageName,image_f,image_s,image_i,company)
{
    if (isInTaggonFrame()) return ; 
    var popupWidth = 502;
    var popupHeight = 230;
    var downloadUrl = '/taggon.php?file=popups/image_download.php&imageID='+escape(ImageID)+'&imageName='+escape(imageName)+'&image_f='+escape(image_f)+'&image_s='+escape(image_s)+'&image_i='+escape(image_i)+'&company='+escape(company)  ;
	var imagePopupWindow = window.open( downloadUrl, "ImageDownload","menubar=0,scrollbars=1, resizable=1,width="+popupWidth+",height="+popupHeight );
    imagePopupWindow.focus();
}

// intersport
function MacCheck()
{
  //check Mac
}

//intersport
//

// cart array
var cartarray=new Array();
var sel="";
function hangtagAddItem(imgid,name)
{
    var newitem=true;
    var index=0;
    if(name=="")
      name="HangTag";
    for(var i=0; i<cartarray.length;i++)
    {
        if(cartarray[i]==imgid)
        {
            newitem=false;
            index=i;
         }
    }
   if(newitem)
   {
     var result=confirm("Do you want to add " + name + " to email file?")
     if (result==true)
     {
        cartarray.push(imgid);
     }
   }
   else
   {
     var result=confirm("The "+name+" is already selected. Do you want to remove it ?")
     if (result==true)
     {
         cartarray[index]=-1;
     }
   }
}
//

function getEmailBody()
{
   var eHtml='<br><br><table width=701 cellSpacing=0 cellPadding=0 border=0>';
   //eHtml +='';

   for($i=0; $i<cartarray.length; $i++)
   {
      var imageid=cartarray[$i];
      if(imageid>0)
      {
      //alert(imageid);
	      eHtml +='<tr><td><table><tr><td>';
	      eHtml +='<img'+ ' src="http://intersport.imagedirector.net/getHangtagsImage.php?imageid='+imageid+'" alt="" border=0>';
	      eHtml +='</td><td>';

	      var elem=document.getElementById(imageid);
          if(!elem)
          {
			elem=document.getElementById("text"+imageid);
          }
          if(elem)
          {
	      	var tbHtml=elem.outerHTML;
	      	eHtml +=tbHtml;
          }


	      eHtml +='</td></tr>';
	      eHtml +='<tr><td colspan=2></td></tr></table></td></tr>';
      }
    }

   eHtml +='</table>';
   //eHtml +='</body></html>';
   //alert(eHtml);
   //alert("l="+cartarray.length);
   return eHtml;

}

//email
function emailHangtags(brand)
{
/*
    var ebody=getEmailBody();
    //alert(ebody);
    var email = prompt("Please enter email to send your selected Hangtags:","");
	if (email != null && email != "")
	{
	   var hangtagsform=document.getElementById('hangtagsForm');
       hangtagsform.email.value=email;
	   hangtagsform.ebody.value=ebody;
       hangtagsform.submit();
	}
    //alert(email);
*/
   if(cartarray.length>0)
   {
     var popurl="http://intersport.taggon.com/handTagPopUp.php?brand="+ brand;
     var popWindow = window.open(popurl,'emailWin','width=720,height=580,scrollbars=yes');
     popWindow.focus();
   }
   else
   {
     alert("No hangtag is selected! ");
   }
}
function detectEditor()
{
	var bname = navigator.appName;
	if (bname.search(/microsoft/i) == 0 && window.top.frames["toolbar"]) {
		return true;
	} else if (bname.search(/netscape/i) == 0) {
		return false;
	} else {
		return false;
	}
}

function goToUrl(newwindow,windowtype,turl,width,height)
{
    if (isInTaggonFrame()) return ; // avoid the popup when in Taggon
	var Editor = detectEditor();
	if (Editor == false)
	{
		if (newwindow == 'false' || !newwindow) {
	        document.location.href = turl;
	    } else {
	        if (windowtype == 'blank') {
	            window.open(turl, '_blank', 'scrollbars=yes,resizable=yes,status=yes,titlebar=yes,toolbar=yes');
	        } else if (windowtype == 'pop') {
	            window.open(turl, '_blank', 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes');
	        }
	    }
	}
}

function makeImagesClickCursor()
{
    var Images = document.getElementsByTagName('IMG');

    for (var x = 0; x < Images.length; x++) {
        onClickValue = Images[x].getAttribute('onclick', 2 );
        if(onClickValue) {
            Images[x].style.cursor = 'pointer';
        }
    };
    
}

var TaggonNoCacheDomainUrl = 'http://www.abb-wfs.ch';
    function tfRequired( field, errmsg, validator ){
        this.field = field ;
        this.errmsg = errmsg ? errmsg : "* is required" ;
        this.validator = validator ? validator : "text" ;
    }
    
    function tfValidateForm( form ){
        if( !tfValidateFields( form ) ) return false ;
        
        form.action = ( (form.action+"").indexOf('http://') == -1 ) ? TaggonNoCacheDomainUrl + form.action : TaggonNoCacheDomainUrl + '/taggon_formcenter.php' ;
        if( form.redirect && (form.redirect.value+"").indexOf('http://') == -1 ) {
            form.redirect.value = 'http://' + self.location.host + form.redirect.value ;
        }
        return true ;
    }

    function tfValidateFields( form ){
        s = '' ;
        for( i = 0; i < tfAllRequiredFields.length; i ++ ){
            r = tfAllRequiredFields[i];
            if( ! tfIsValid(form, r) ) {
                if( form.elements[ r.field ].select ) form.elements[ r.field ].select();
                alert( r.errmsg );
                return false ;
            }
            //s += 'FieldName=' + r.field + ' Value=' + form.elements[ r.field ].value + ' ErrMsg=' + r.errmsg + ' Validator=' + r.validator + "\n";
        }
        return true ;
    }

    function tfIsValid( form, field ){
        if( !form.elements[ field.field ] ) return true ;
        value = tfGetFieldValue( form.elements[ field.field ] ) ;
        //alert( value + ' ' + field.validator + (field.validator).toLowerCase() );
        switch( (field.validator).toLowerCase() ){
            case 'email' :
                var emailCheck1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); // invalid entry check
                var emailCheck2 = new RegExp("^.+\@(\\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); // valid e-mail
                return  ( !emailCheck1.test(value) && emailCheck2.test(value) ) ;
            case 'text' :
                return '' != value ;
            case 'int' :
                var intCheck = new RegExp( "^[0-9]+$" );
                return intCheck.test( value ) ;
            default :
                // do nothing
        }
        return true ;
    }

    function tfGetFieldValue( field ) {
        if( ! field ) return null ; // the field doesn't exist
        type = field.length != undefined && field.type == undefined ? 'radio' : field.type ;
		switch( type.toLowerCase() ){
			case 'select' :
			case 'select-one' :
			case 'select-multiple' :
				return field.selectedIndex != -1 ? field.options[field.selectedIndex].value : null ;
			case 'checkbox' :
			     return field.checked ? field.value : '' ;
			case 'radio' :
                 if( field.length == undefined ){
                    return field.checked ? field.value : "" ;
                 };
			     for( var i = 0 ; i < field.length; i ++ ){
			         if( field[i].checked ) {
			             return field[i].value ;
                     }
                 };
                 return '' ;
			case 'text' :
			case 'hidden' :
			default :
				return field.value ;
			
		}
    }


var tfAllRequiredFields = new Array() ;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function taggonNewsletterForm(){
    var form = document.getElementById('idFrmNewsLetter');
    if( !form ) form = document.forms[0];
    if( !form ) return ;
    nl_errmsg = form._taggon_errmsg ? form._taggon_errmsg.value : "* is required" ;
    tfAllRequiredFields[ tfAllRequiredFields.length ] = new tfRequired( "email", nl_errmsg, "email" );
    tfAllRequiredFields[ tfAllRequiredFields.length ] = new tfRequired( "name", nl_errmsg, "" );
    if( !tfValidateFields(form) ) return false;
    
    features = "" ;
    if( form._taggon_popup_features )
        features = form._taggon_popup_features.value ;
	
    isPopup = features.indexOf( 'popup=yes' ) != -1 ;
    url = '/taggon_cmd.php?_taggon_cmd=newsletter-signup&_taggon_redirect_aid=' + escape(form._taggon_redirect_aid.value) + '&email=' + escape(form.email.value) + "&name=" + escape(form.name.value) + "&company=" + escape(form.company.value) + "&_taggon_mailing_group=" + escape(form._taggon_mailing_group.value) + "&ispopup=" +( isPopup ? 1 : 0 ) + ( form._taggon_email_exists_msg ? "&_taggon_email_exists_msg=" + escape(form._taggon_email_exists_msg.value) : "" );
    //alert(url + "\n" + features) ;
    wowOpen( url, 'newsletter', features );
    return false ; // always return false to avoid executing the "href" in link
}


function taggonGeneralSignup(){
    var form = document.getElementById('idFrmTaggonSignup');
    if( !form ) return false;
    this.form = form;
    var Me = this;
    
    this.validForm = function(){
        var nl_errmsg = form._taggon_errmsg ? form._taggon_errmsg.value : "* is required" ;
        tfAllRequiredFields[ tfAllRequiredFields.length ] = new tfRequired( "email", nl_errmsg, "email" );
        var rfields = form._taggon_require_fields.value.split(',');
        for( var i=0, N=rfields.length; i<N; i++ ){
            if( 'object' != typeof(form[rfields[i]]) ) continue;
            tfAllRequiredFields[ tfAllRequiredFields.length ] = new tfRequired( rfields[i], nl_errmsg, "" );
        };
        return tfValidateFields(form);
    }

	this.response = function( R ){
		if( '0' == R.isError ){
		   if( Me.form._taggon_redirect ){
    		   var url = Me.form._taggon_redirect.value;
    		   if( '' != url ){
    		      location.href = url ;
    		      return ;
               };
           };
            alert(Me.form._taggon_thanks_msg.value);
        }else{
            alert( "Error Occurred While Processing Request.\n"+R.errormsg );
        };
		return ;
	}
	
	
	if( !this.validForm() ){
	   return false ;
   };

   taggonAjax( this.form, "/modules/roles/xaruser/ajax_taggon_signup.php", this.response );
	return false ;
}


  
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function isInTaggonFrame(){
	try{
		return undefined == window.top.frames["toolbar"].checkRightClick ? false : true;
	}
	catch(e){};
	return false ;
    //return (window != window.top); // avoid some the popup when in Taggon
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function popupPrintArticle(){
    if (isInTaggonFrame()) return ; // avoid the popup when in Taggon
    
    if( self.articleId && parseInt(self.articleId) > 0 ){
        wpa = window.open( '/taggon.php?file=popups/print_article.php&aid=' + self.articleId, 'ArticlePrint', 'width=710,menubar=0,toolbar=0,resizable=1,scrollbars=1' );
        if( wpa ) wpa.focus() ; // if not block by the popup blocker
    }
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function xarTaggonSearch(){
    if (isInTaggonFrame()) return ; // avoid the popup when in Taggon

    if( self.document._taggon_search_form ){
        form = self.document._taggon_search_form ;
        form.action = ( (form.action+"").indexOf('http://') == -1 ) ? TaggonNoCacheDomainUrl + '/' + form.action : TaggonNoCacheDomainUrl ;
        form.submit();
    }
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function wowOpen( URL, windowName, windowFeatures ){
    //alert( URL + "\n" + windowName + "\n" + windowFeatures );
    if (isInTaggonFrame()) return ; // avoid the popup when in Taggon
    URL = URL.replace('__userid__',tUser);  // to replace the dummy imagedirector userid with current taggon userid ;
    var sUrl = URL; 

    var oRegex = new Object() ;
    oRegex.UriProtocol = new RegExp('^(((http|https|ftp|news):\/\/)|mailto:|imgdir_download:|imgdir_slideshow:|imgdir_category:|imgdir_largerimage:)', 'gi') ; 
	var sProtocol = oRegex.UriProtocol.exec( URL ) ;
	if ( sProtocol )
	{
		sProtocol = sProtocol[0].toLowerCase() ;
		var sUrl = URL.replace( oRegex.UriProtocol, '' ) ;
	} ;
	
	var isPopup = windowFeatures.indexOf( 'popup=yes' ) != -1 ;
    switch( true ){
        case ( "imgdir_download:" == sProtocol ) :
            document.location.href = sUrl ;
            break ;
        case ( "imgdir_category:" == sProtocol ) :
            popupImgDirCategory( sUrl,windowName, windowFeatures );
            break ;
        case ( "imgdir_slideshow:" == sProtocol ) :
            popupImgDirSlideShow( sUrl,windowName, windowFeatures );
            break ;
        case ( "mailto:" == sProtocol ) :
            break ;
        case ( "imgdir_largerimage:" == sProtocol ) :
            break ;
        case ( "ftp://" == sProtocol ) :
            sUrl = (URL.indexOf('ftp://') ==-1) ? URL : sProtocol+sUrl;
            //sUrl = '/taggon_ftp_download.php?_taggon_cmd=ftp-download&ftpfile=' + escape(sUrl) ;
            sUrl = '/taggon.php?file=popups/ftp_download.php&ftpfile=' + escape(sUrl) ;
            isPopup ? openAutoCenterWin( sUrl, windowName, windowFeatures ) : document.location.href = sUrl ;
            break ;
        default :   
        case ( "http://" == sProtocol ) :
            sUrl = (URL.indexOf('http://') ==-1) ? URL : sProtocol+sUrl;
            isPopup ? openAutoCenterWin( sUrl, windowName, windowFeatures ) : document.location.href = sUrl ;
            break ;
    }
    return false ;
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
   When the url is Taggon internal article url, and the popup has feature 'articleOnly=yes', we have to convert the url
   from /articles/xxxx to /taggon_cmd.php?_taggon_cmd=xxxx. The popup window will only display the article body, no xaraya theme apply. 
*/
function wowOpenConvertPopupUrl( url ){
	try{
		var umatch = url.match( /\/articles\/(\d+)(\.html)*/i );
		var aid = parseInt(umatch[1]) ; 
		if( aid > 0 ){
			return '/taggon_cmd.php?_taggon_cmd=popup&aid=' + aid ; 
		}
	} catch(e){
		return url ;
	}
	return url ;
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function parsePopupFeatuers(windowFeatures){
	s = '' ;
	var oFeatures = new Object() ;
    var parts = windowFeatures.split(',');
    for( i = 0; i < parts.length; i ++ ){
    	n = parts[i].indexOf('=');
    	if( -1 == n ) continue;
    	k = parts[i].substr(0,n);
    	v = parts[i].substr(n+1);
		if ( v.toLowerCase() == ( 'yes' || '1' ) )
			oFeatures[k] = true ;
		else if ( (! isNaN( v ) && v != 0) || ('auto' == v ) )
			oFeatures[k] = v ;
		s += k + '=' + v + ',';	
	};
	//alert(s);
	return oFeatures ;
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function openAutoCenterWin(URL, windowName, windowFeatures, dW, dH ){
    try{
        var oFeatures = parsePopupFeatuers(windowFeatures);
        if( oFeatures['articleOnly'] ){
        	URL = wowOpenConvertPopupUrl(URL);
		};
        
        if( !oFeatures['autocenter'] || oFeatures['fullscreen'] ){
            return window.open(URL, windowName, windowFeatures);
        };
        
        
        w = parseInt(oFeatures['width']);
        h = parseInt(oFeatures['height']);
        w = w > 0  ? w  : (dW?dW:640) ;
        h = h > 0 ? h : (dH?dH:480) ;

        if( screen ){
            t    = (screen.height - h) / 2  ;
            l   = (screen.width - w)   / 2 ;
        } else {
            t    = 250 ;
            l   = 250 ;
        } ;

        windowFeatures = (w>0?",width="+w:"") + (h>0?",height="+h:"") + (t>0?",top="+t:"") + (l>0?",left="+l:"") + "," + windowFeatures.replace(/(,width=\s*\d+\s*|,height=\s*\d+\s*|,top=\s*(\d+|auto)\s*|,left=\s*(\d+|auto)\s*)/gi, "")  ;
        return window.open( URL, windowName, windowFeatures ) ;
    } catch( e ) {} ;
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function popupImgDirCategory( cat, windowName, windowFeatures ){
    if (isInTaggonFrame()) return ; // avoid the popup when in Taggon
    var caturl = "http://abb.imagedirector.net/?autolog=true&iUser=&iPassword=&category=" + cat ;
    if( 1 == arguments.length ) return window.open( caturl, 'winImgDir', 'location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,fullscreen=no,resizable=yes' );
    
	if( windowFeatures && windowFeatures.indexOf( 'popup=yes' ) != -1 ){
        wimc = openAutoCenterWin( caturl, windowName, windowFeatures );
        if( wimc ) wimc.focus();
    } else {
        window.location = caturl ;
    }
}


function popupImgDirSlideShow( params, windowName, windowFeatures ){
    if (isInTaggonFrame()) return ; // avoid the popup when in Taggon
    var url = tImgDirUrl + 'slideShow.html?company='+company+'&userid='+tUser+'&CurrentSlide=1&pic=1&slideShowMode=1&external=1&'+unescape(params);
	if( windowFeatures && windowFeatures.indexOf( 'popup=yes' ) != -1 ){
        wimc = openAutoCenterWin( url, windowName, windowFeatures, 500, 500 );
        if( wimc ) wimc.focus();
    } else {
        window.location = url ;
    }
}


function getCookie(name) { 
    var c = document.cookie;
    var index = c.indexOf(name + "=");
    if (index == -1) return null;
    index = c.indexOf("=", index) + 1;
    var endstr = c.indexOf(";", index);
    if (endstr == -1) endstr = c.length;
    v = unescape(c.substring(index, endstr));
    return v ;
}

function setCookie(name, value) { 
  document.cookie =name + "=" + ( value ? escape(value) : null );
}












function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function idImageDynInfo(){
    var Me = this;
    var allImages = [];
    var ajaxParas = [];

    function getE(id){
        return document.getElementById(id);
    }
    
    this.getAllImages = function(){
        var imgs = document.getElementsByTagName('IMG');
        var O = [];
        ajaxParas = [];
        for( var i=0, n = imgs.length; i < n; i ++ ){
            try{
                var E = imgs[i];
                //var s = E.getAttribute('title');
                //if( s ) continue; // skip images with existing title
                var id = E.getAttribute('id');
                if( !id ) id = 'id' + Math.random();
                var src = E.getAttribute('src');
                var imgID = src.match( /\/([0-9]+)\-s/gi );
                if( !imgID[0] ) continue;
                var imageID = imgID[0].replace( /[\/\-s]/g, '' );
                ajaxParas.push( 'ids[' + id + ']=' + imageID );  
                O.push(id);
            }
            catch(e){};
        }; // for
        return O;
    }
    

    this.showImagesInfo = function( R ){
        //alert(R.date + allImages);
        var s = '';
        for( var i = 0, n=allImages.length; i < n; i ++  ){
            var id = allImages[i]; 
            var E = getE(id);
            if( !E ) continue;
            //E.setAttribute( 'title', R[id] );
            $j('#'+id).qtip({
                   content: R[id],
                   position: {
                      corner: {
                         target: 'topLeft',
                         tooltip: 'bottomLeft'
                      }
                   },
                   style: { 
                      border: {
                         width: 1,
                         radius:5,
                         color: '#6699CC'
                      },
                      width: 300
                   } 
            }); // qtip                  
        }; // for
    }
    

    
    this.queryImagesInfo = function(){
        allImages = this.getAllImages();
        taggonAjax( ajaxParas.join('&'), "/taggon/3.1/Editor/_code/idQuryImagesInfo.php", Me.showImagesInfo );
    }
    
    
    
}

var idFetchImagesInfoObj = new idImageDynInfo(); 
function idFetchImagesInfo(){
    if( !isInTaggonFrame() ) {
        idFetchImagesInfoObj.queryImagesInfo();
    }; // only query when it's not in taggon
}

addLoadEvent( idFetchImagesInfo );



// - - - - - Javascript /themes/abb/includes/dhtmlMenu.js.php included

<!--
var loading = true;
var preview = false;
var menuOverOb = null
var menuOverTimer = null
var menuOutTimerArray = new Array()
var menuOverDelay = 300
var menuOutDelay = 200
var menuActiveOverFlagArray = new Array()
var menuActiveObArray = new Array()

/// functions
function blockEvents(evt)
{
    evt = (evt) ? evt : event;
    var blockit = false;
    //
    if (window.top.frames["toolbar"]) {
    	window.top.frames["toolbar"].setMyEvent(evt);
    	//window.top.frames["toolbar"].showTableMenu(evt);
    }
    var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement: null);
    if (elem && elem.id && elem.id.indexOf('DhtmlMenu-') > -1) {
        if (evt.cancelBubble) {
            evt.cancelBubble = true;
        }
        //alert('Tag:' + elem.tagName.toLowerCase() + '\nId:' + elem.id);
        return false;
    } else if (elem && elem.tagName && elem.tagName.toLowerCase() == 'table') {
        //alert('Tag:' + elem.tagName.toLowerCase() + '\nId:' + elem.id);
        //window.top.frames["toolbar"].showTableMenu(evt);
        return false;
    } else if (elem && elem.tagName && elem.tagName.toLowerCase() == 'td') {
        //alert('Tag:' + elem.tagName.toLowerCase() + '\nId:' + elem.id);
        //window.top.frames["toolbar"].showTableMenu(evt);
        return false;
    } else {
        return false;
    }
}

try{
    if (window.top.frames["toolbar"]) {
        document.oncontextmenu = blockEvents;
    }
}
catch( e ){} ;

function w3left(ob) {
	var x = 0;
	while ( ob != null) {
		x += ob.offsetLeft;
		ob = ob.offsetParent;
	}
	return x; 
}

function w3top(ob) {
	var y = 0;
	while ( ob ) {
		y += ob.offsetTop;
		ob = ob.offsetParent;
	}
	return y; 
}

function w3width(ob) {
	return ( ob ? ob.offsetWidth : 0 );
}

function w3height(ob) {
	return ( ob ? ob.offsetHeight : 0 );
}

function classNameTrimOver (el) {              // trim off a trailing '-over' from an element's className
	if (/^(.+)-over$/ .test(el.className)) {
		el.className = (RegExp.$1);
	}
}


// Used for both Menu Bar (level=0) and Dropdowns (level=1 to 4)
// raymond@20040821: add ptid, xaraya publish type id
function menuInit(el,href,submenuID,menuLevel) {    // called for first time for this element. Convert to "method" method.
	//if ( loading ) return ;
         //alert("l="+loading);
    el.onmouseover = menuOver;
	el.onmouseout = menuOut;
	el.href = href;
	el.submenu = document.getElementById(submenuID);
	el.menuLevel = menuLevel;
	if ( el.submenu ) {
		el.submenu.menuLevel = menuLevel;
		el.submenu.onmouseover = menuActiveOver;
		el.submenu.onmouseout = menuActiveOut;
	}
	el.onclick = menuClick;
    if (window.top.frames["toolbar"]) {
        el.oncontextmenu = menuToolBar;
    }
	el.onmouseover();
}

function menuToolBar() {
    this.style.cursor = "hand";
//alert('test');
    // function found in menuToolBar.js
    window.top.frames["toolbar"].showMenuToolBar(false);
}


function menuClick() {
	if ( this.href != '' ) {
		this.style.cursor = "wait";
		this.style.color = "#808080";
		//alert( this.target ) ;
		// add this.target detection, raymond@2004-09-17, during developing Taggon FAQ, the link need to submit to iframe hiddenTaggonAppFrame
                 if (window.top.frames["toolbar"] && window.top.frames.length > 0) {
    	            if (window.top.frames["toolbar"].discardChangedContainer()) {
     		           if( !this.target ) window.setTimeout("document.location = '" + this.href + "'", 10);
                     }
                 } else {
     		        if( !this.target ) window.setTimeout("document.location = '" + this.href + "'", 10);
                 }
	}
}


function menuVFlatInit(el,href,menuLevel) {    // called for first time for this element. Convert to "method" method.
	if ( loading ) return
         //alert("l="+loading);
       	el.onmouseover = menuOver;
    el.style.cursor = "hand";
	el.onmouseout = menuOut;
	el.href = href;
	el.menuLevel = menuLevel;
	el.onclick = menuClick;
    if (window.top.frames["toolbar"]) {
        el.oncontextmenu = menuToolBar;
    }
	el.onmouseover();
}

function menuOver() { // onmouseover method for button that is not active
	if ( this.submenu && top.editMode !== "xnavigate" ) {
		menuOverTimer = window.setTimeout("menuOverExpire()",menuOverDelay);  // schedule the "big" effect
		menuOverOb = this;
	}
	// Quick Effect
	this.className += '-over';
	if ( this.href == '' ) this.style.cursor = 'default';	// if it's not a link, don't show the "hand".
}

function menuOut() {                       // onmouseout event for a non-active object - only has a Quick Effect,
	window.clearTimeout(menuOverTimer);
	menuOverTimer = null;
	menuOverOb = null;
	classNameTrimOver(this);
}


function menuActiveOver() {   // mouse has re-entered an active object, either button or dropdown.
	// kill all Out timers at this and higher levels.
	var n = this.menuLevel;
	menuActiveOverFlagArray[n] = true;
	for ( var i=n; i>=0; --i ) {
		window.clearTimeout(menuOutTimerArray[i]);
		menuOutTimerArray[i] = null;    // should not be needed!
	}
}

function menuActiveOut() {    // mouse has exited an active object, either button or dropdown
	// start an Out timer at this menu level.
	var n = this.menuLevel;
	menuActiveOverFlagArray[n] = false;
	menuOutTimerArray[n] = window.setTimeout("menuOutExpire(" + n + ")",menuOutDelay);
}

function menuOverExpire() {   // mouse has been over menuOverOb long enough to activate it
	var el = menuOverOb;
	var n = el.menuLevel;
	// accelerate the deactivation of any active objects at levels n or lower   LATER. FOR NOW, SET OUT DELAY SHORTER THAN OVER DELAY
	menuActiveObArray[n] = el;
	el.onmouseover = menuActiveOver;
	el.onmouseout = menuActiveOut;
    var isSafari = -1 != navigator.userAgent.toLowerCase().indexOf('safari') ;
	if ( n == 0 ) {
		var ddTop = w3top(el) + w3height(el) - (isSafari ? 6 : 17);
		var ddLeft = w3left(el) + w3width(el) - w3width(el.submenu) - (isSafari ? 0 : 273);
	} else {		
		var ddTop = w3top(el) - w3height(el) + (isSafari ? 0 : 3);
		var ddLeft = w3left(el) - w3width(el) - w3width(el.submenu) - (isSafari ? 0 : 111);
	};
	
	var ddStyle = el.submenu.style;
//alert("t="+ddTop_n);
//	ddStyle.top = ddTop;
//	ddStyle.left = ddLeft;
	ddStyle.top = ddTop;
	ddStyle.left = ddLeft;

	ddStyle.visibility = 'visible';

}

function menuOutExpire(n) {
	menuDeactivate(menuActiveObArray[n]);
	menuOutTimerArray[n] = null;     // should not be required
	var higher = n - 1;
	if ( (higher >= 0) && (menuActiveOverFlagArray[higher] == false) && (menuOutTimerArray[higher] == null) ) {
		menuOutExpire(higher);
	}
}

function menuActivate(el) {

}

function menuDeactivate(el) {
	el.onmouseover = menuOver;
	el.onmouseout = menuOut;
	el.submenu.style.visibility = 'hidden';
	el.submenu.style.top = -1000;
	classNameTrimOver(el);
}
//-->


// - - - - - Javascript includes/js.php/formValidation.js.php included

// (c) Onison Canada Corporation - Taggon CMS
// ==========================
// email : sales@onison.com
// web : http://www.onison.com


var emailCheck1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); // invalid entry check
var emailCheck2 = new RegExp("^.+\@(\\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); // valid e-mail


function Form1_Validator(theForm)
{

  if (theForm.FirstName.value == "" || theForm.FirstName.value == "First Name")
  {
    alert("Please enter a value for the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.LastName.value == "" || theForm.LastName.value == "Last Name")
  {
    alert("Please enter a value for the \"LastName\" field.");
    theForm.LastName.select();
    return (false);
  }

  if (theForm.Company.value == "" || theForm.Company.value == "Last Name")
  {
    alert("Please enter a value for the \"Company\" field.");
    theForm.Company.select();
    return (false);
  }

  if (theForm.Email.value == "" || theForm.Email.value == "E-Mail")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.select();
    return (false);
  }


  if(!(!emailCheck1.test(theForm.Email.value) && emailCheck2.test(theForm.Email.value))){
    alert("Please enter a valid E-Mail address.");
    theForm.Email.select();
    return false;
  }

  if(theForm.Company.value == "")
    return false;
/*
  if(theForm.Address.value == "")
    return false;
  if(theForm.PostCode.value == "")
    return false;
  if(theForm.City.value == "")
    return false;
  if(theForm.Country.value == "")
    return false;
  if(theForm.Telephone.value == "")
    return false;
*/
  return (true);
}



//:: _outputJsFromFile()

var showCheckoutLink = false

var UserIsLoggedIn = false

// isAllowSaveStatic():true, time: 0.15508