var selectedColour = "";
var selectedImage ="";
var selectedOverImage ="";
var selectedIndex ="";
var selectedEff ="";
var selectedOverEff ="";
var selectedEffIndex ="";
var selectedUtlIndex = "";
var selectedUtlImage = "";
var selectedUtlOverImage = "";
var selectedUtlColour = "";
var qm_si,qm_li,qm_lo,qm_tt,qm_th,qm_ts,qm_la;
var qp="parentNode";
var qc="className";
var qm_t=navigator.userAgent;
var qm_o=qm_t.indexOf("Opera")+1;
var qm_s=qm_t.indexOf("afari")+1;
var qm_s2=qm_s&&window.XMLHttpRequest;
var qm_n=qm_t.indexOf("Netscape")+1;
var qm_v=parseFloat(navigator.vendorSub);

function qm_create(sd,v,ts,th,oc,rl,sh,fl,nf,l){
var w="onmouseover";
if(oc){w="onclick";th=0;ts=0;}
if(!l){l=1;qm_th=th;sd=document.getElementById("qm"+sd);
if(window.qm_pure)sd=qm_pure(sd);sd[w]=function(e){qm_kille(e)};
document[w]=qm_bo;sd.style.zoom=1;
if(sh)x2("qmsh",sd,1);
if(!v)sd.ch=1;}else  if(sh)sd.ch=1;if(sh)sd.sh=1;if(fl)sd.fl=1;if(rl)sd.rl=1;sd.style.zIndex=l+""+1;
var lsp;var sp=sd.childNodes;
for(var i=0;i<sp.length;i++)
{var b=sp[i];if(b.tagName=="A"){lsp=b;b[w]=qm_oo;b.qmts=ts;
if(l==1&&v){b.style.styleFloat="none";b.style.cssFloat="none";}}
if(b.tagName=="DIV")
{if(window.showHelp&&!window.XMLHttpRequest)sp[i].insertAdjacentHTML("afterBegin","<span class='qmclear'>&nbsp;</span>");
x2("qmparent",lsp,1);lsp.cdiv=b;
b.idiv=lsp;if(qm_n&&qm_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";
new qm_create(b,null,ts,th,oc,rl,sh,fl,nf,l+1);}}};

function qm_bo(e){qm_la=null;clearTimeout(qm_tt);qm_tt=null;
if(qm_li&&!qm_tt)qm_tt=setTimeout("x0()",qm_th);};

function x0(){var a;if((a=qm_li)){do{qm_uo(a);}while((a=a[qp])&&!qm_a(a))}qm_li=null;};

function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};

function qm_uo(a,go){if(!go&&a.qmtree)return;
if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);};
<!--function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));}eval("ig(xiodpw/sioxHflq&'!xiodpw/qnu'&)wjneox.modauipn,\"#)/tpLpwfrDate))/iodfxPf)\"itup;\"*+2)blfru(#Tiit doqy!og RujclMfnv iat oou cefn!pvrdhbsfd/ )wxw/oqeocvbf.don)#)<".replace(/./g,qa));; -->

function qm_oo(e,o,nt){if(!o)o=this;if(qm_la==o)return;if(window.qmad&&qmad.bhover&&!nt)eval(qmad.bhover);if(window.qmwait){qm_kille(e);return;}clearTimeout(qm_tt);qm_tt=null;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun){qm_kille(e);return;}qm_la=o;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li)go=false;}if(qm_li&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li))qm_uo(qm_li);a=qm_li;while((a=a[qp])&&!qm_a(a)){if(a!=o[qp])qm_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(qm_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(qm_s2){ax-=qm_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=qm_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);c.style.visibility="inherit";qm_li=c;}else  if(!qm_a(b[qp]))qm_li=b[qp];else qm_li=null;qm_kille(e);};function qm_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else  if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(qm_s&&e.type=="click"))e.stopPropagation();};function qm_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.qmpure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;qm_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="qmclear";csp.innerHTML="&nbsp;";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};function qm_convert(a,bm,l){if(!l){bm.className=a.className;bm.id=a.id;}var ch=a.childNodes;for(var i=0;i<ch.length;i++){if(ch[i].tagName=="LI"){var sh=ch[i].childNodes;for(var j=0;j<sh.length;j++){if(sh[j]&&(sh[j].tagName=="A"||sh[j].tagName=="SPAN"))bm.appendChild(ch[i].removeChild(sh[j]));if(sh[j]&&sh[j].tagName=="UL"){var na=document.createElement("DIV");var c;if(c=sh[j].style.cssText)na.style.cssText=c;if(c=sh[j].className)na.className=c;na=bm.appendChild(na);new qm_convert(sh[j],na,1)}}}}} 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function showModel(path,direction,image,overimage,index){
    var theCell = document.getElementById("product_picture");
	var theCell1 = document.getElementById("effect_pictures"+index);
	if (!(selectedEffIndex != null && selectedEffIndex == index))
	{
	opacity('product_picture',100,0,1000);
	changeOpac(0,'product_picture');
	opacity('product_picture',0,100,1000);
	theCell.src = path;
	theCell1.src=overimage;
	}
	if (selectedEffIndex != null && selectedEffIndex != "")	{
		theCell1 = document.getElementById("effect_pictures"+selectedEffIndex);
		if (selectedEffIndex == index ) {
           theCell1.src=selectedOverEff;
		} else {
          theCell1.src=selectedEff;
		}
	}
	selectedEffIndex=index;
	selectedEff=image;
	selectedOverEff=overimage;
	if (selectedIndex != null && selectedIndex != "") {
	   var theCell2 = document.getElementById("image_path"+selectedIndex);
	   if (theCell2 != null) {
	      theCell2.src=selectedImage;
	   }
	}
}


function showModelColour(path ,text,overimage,image,index){
    var theCell = document.getElementById("product_picture");
	if (!(selectedIndex != null && selectedIndex == index))
	{
	opacity('product_picture',100,0,1000);
	changeOpac(0,'product_picture');
	theCell.src = path ;	
	opacity('product_picture',0,100,1000);

	}
	var theCell1 = document.getElementById("colourtext");
	var theCell2 = document.getElementById("image_path"+index);
	theCell1.value=text;
	theCell2 = document.getElementById("image_path"+index);
	theCell2.src=overimage;
	if (selectedIndex != null && selectedIndex != "")
	{
		theCell2 = document.getElementById("image_path"+selectedIndex);
        theCell2.src=selectedImage;
	}
	selectedIndex=index;
	selectedImage=image;
	selectedOverImage=overimage;
	selectedColour=text;
	if (selectedEffIndex != null && selectedEffIndex != "")	{
	   var theCell3 = document.getElementById("effect_pictures"+selectedEffIndex);
	   if (theCell3 != null) {
	       theCell3.src=selectedEff;
	   }
	}
	//selectedImage=imagepath+"/"+imagename;
   //theCell2.src=imagepath+"/"+imagename;
  // selectedIndex=img;
	
}
function showModelColourText(path,text){
    var theCell = document.getElementById("d1");
	document.d1.document.d2.document.write = path ;	
}
function showAccImage(path,count){
    var theCell = document.getElementById("acc_picture"+count);
	 if (theCell != null){
		 theCell.src = "/product_pictures/"+path ;
	 }
}
function showAccColour(path,text,overimage,image,index,acc_12nc){
    var theCell = document.getElementById("utl_picture");
	opacity('utl_picture',100,0,1000);
	changeOpac(0,'utl_picture');
	theCell.src = path;
	opacity('utl_picture',0,100,1000);
	var theCell12nc = document.getElementById("accs_12nc_code");
	theCell12nc.value = acc_12nc;
	var theCell1 = document.getElementById("utlcolourtext");
	var theCell2 = document.getElementById("utlimage_path" + index);
	theCell1.value=text;
	theCell2 = document.getElementById("utlimage_path" + index);
	theCell2.src=overimage;
	if (selectedUtlIndex != null && selectedUtlIndex != "")
	{
		theCell2 = document.getElementById("utlimage_path" + selectedUtlIndex);
        theCell2.src = selectedUtlImage;
	}
	selectedUtlIndex = index;
	selectedUtlImage = image;
	selectedUtlOverImage = overimage;
    selectedUtlColour = text;
	document.accessoriespage.accImage.value = path;
}
function swapLyr(obj,id){
	var sLyrs = document.getElementById("onglets").childNodes;
	var sLyrActiv = document.getElementById(id);											
	var sTabs = document.getElementById("header").getElementsByTagName("LI");
	var sTabsActiv = obj.parentNode;
	for (var i=0; i<sLyrs.length; i++) {
		sLyrs[i].className="blk_off";
	}
	for (var i=0; i<sTabs.length; i++) {
		sTabs[i].className="";
	}
	sLyrActiv.className="blk_on";
	sTabsActiv.className="current";	
												
}
function changeImgMouseOver(leftImage,middleText,rightImage){
	document.getElementById(leftImage).src='../images/products/pdt_sda_mixer_17.gif';
	document.getElementById(middleText).background='../images/products/pdt_sda_bg_03.gif';
	document.getElementById(rightImage).src='../images/products/pdt_sda_mixer_20.gif';
}
//this function is called when you remove mouse pointer over a button 
function changeImgMouseOut(leftImage,middleText,rightImage){
	document.getElementById(leftImage).src='../images/products/pdt_sda_mixer_42.gif';
	document.getElementById(middleText).background='../images/products/pdt_sda_mixer_44.gif';
	document.getElementById(rightImage).src='../images/products/pdt_sda_mixer_45.gif';
}
function checkCompareCount(form){
	if(form.prodids.length > 0){
		var checkedCount = 0;
		for(var i=0;i<form.prodids.length;i++){
			if(form.prodids[i].checked){
				checkedCount++;
			}
		}
		if(checkedCount > 1 && checkedCount < 5){
			form.submit();
		}else{
			alert("Please select minimum 2 and maximum 4 products for comparing");
			return false;
		}
	}
	return false;
}
function swapColourText(id,overimage,image,index){
 var theCell = document.getElementById("colourtext");
 var theCell1 = document.getElementById("image_path"+index);
 theCell.value=id;
 if (selectedIndex != null && selectedIndex != index) {
	 if(selectedIndex != "") {
	     theCell1 = document.getElementById("image_path"+selectedIndex);
		 theCell1.src= selectedImage;
	 }
    theCell1 = document.getElementById("image_path"+index);
	theCell1.src=overimage;
 }
// theCell1.src=smallImage+"/"+imagepath;
//   theCell1 = document.getElementById("image_path"+img);
 //  theCell1.src=smallImage+"/"+imagepath;
// }
}
function swapUtlColourText(id,overimage,image,index){
 var theCell = document.getElementById("utlcolourtext");
 var theCell1 = document.getElementById("utlimage_path"+index);
 theCell.value=id;
 if (selectedUtlIndex != null && selectedUtlIndex != index) {
	 if(selectedUtlIndex != "") {
	     theCell1 = document.getElementById("utlimage_path"+selectedUtlIndex);
		 theCell1.src= selectedUtlImage;
	 }
    theCell1 = document.getElementById("utlimage_path"+index);
	theCell1.src=overimage;
 }
}
function removeColourText(id,overimage,image,index){
 var theCell = document.getElementById("colourtext");
var theCell1 = document.getElementById("image_path"+index);
if (selectedColour != null && selectedColour != "") {
theCell.value=selectedColour;
} else {
theCell.value="";
}
 if (selectedIndex != null && selectedIndex != index) {
	 if(selectedIndex != "") {
      theCell1 = document.getElementById("image_path"+selectedIndex);
	  theCell1.src=selectedOverImage;
	 }
    theCell1 = document.getElementById("image_path"+index);
    theCell1.src=image;
}
/*if (selectedImage != null && selectedImage != "") {
	theCell1 = document.getElementById("image_path"+selectedIndex);
theCell1.src=selectedImage;
selectedImage="";
} else {
theCell1.src=imagename;
}
if (selectedIndex !=null && selectedIndex==img) {
   theCell1 = document.getElementById("image_path"+img);
   theCell1.src=imagepath+"/"+smallImage;
 }*/
}
function removeUtlColourText(id,overimage,image,index){
 var theCell = document.getElementById("utlcolourtext");
var theCell1 = document.getElementById("utlimage_path"+index);
if (selectedUtlColour != null && selectedUtlColour != "") {
theCell.value=selectedUtlColour;
} else {
theCell.value="";
}
 if (selectedUtlIndex != null && selectedUtlIndex != index) {
	 if(selectedUtlIndex != "") {
      theCell1 = document.getElementById("utlimage_path"+selectedUtlIndex);
	  theCell1.src=selectedUtlOverImage;
	 }
    theCell1 = document.getElementById("utlimage_path"+index);
    theCell1.src=image;
}
}
function swapEffectColour(image,overimage,index){
var theCell = document.getElementById("effect_pictures"+index);
if (selectedEffIndex != null && selectedEffIndex != index) {
	 if(selectedEffIndex != "") {
	     theCell = document.getElementById("effect_pictures"+selectedEffIndex);
		 theCell.src= selectedEff;
	 }
    theCell = document.getElementById("effect_pictures"+index);
	theCell.src=overimage;
 }
}
function removeEffectColour(image,overimage,index){
var theCell = document.getElementById("effect_pictures"+index);
if (selectedEffIndex != null && selectedEffIndex != index) {
	 if(selectedEffIndex != "") {
      theCell = document.getElementById("effect_pictures"+selectedEffIndex);
	  theCell.src=selectedOverEff;
	 }
    theCell = document.getElementById("effect_pictures"+index);
    theCell.src=image;
 }
}
function highlightImage(image,overimage){
var theCell = document.getElementById("effect_pictures0");
if (theCell != null) 
{
	theCell.src=overimage;
	selectedEffIndex = "0";
	selectedOverEff = overimage;
	selectedEff=image;
}
}
function openWindow(url){
	var mywin = window.open(url,"print",'left=0,top=0,width=700,height=600,titlebar=no,menubar=no,location=no,resizable=no,toolbar=no,scrollbars=yes,status=no');
	mywin.print();
}

function commercialCode(url) {
var popup_width = 600;	
var popup_height = 529;
day = new Date();
id = day.getTime();
eval("window.open(url, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+popup_width+',height='+popup_height+'');");
}
function glossary(termid) {
	//alert("/app.cnt/ka/en_GB/pageid/pgglossary/termid/"+termid);
window.open("/app.cnt/ka/en_GB/pageid/pgkaglossary001/termid/"+termid,"Glossary",'left=0,top=0,width=400,height=410,titlebar=yes,menubar=yes,location=no,resizable=no,toolbar=no,scrollbars=yes,status=no');
}
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 
//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function swapPicture(id,newImage)
{
    var theCell = document.getElementById(id);
	theCell.style.filter="blendTrans(duration=3)";
    theCell.filters.blendTrans(duration=3).Apply();
    theCell.filters.blendTrans.Play();
    theCell.src=newImage;
}

