//<![CDATA[

//the menu:
function onmouse(cell)
{
document.getElementById(cell).style.color = "#3E98EB";
document.getElementById(cell).style.fontSize = "14px";
document.getElementById(cell).style.position = "relative";
document.getElementById(cell).style.top = "-5px";
}

function onout(cell)
{
document.getElementById(cell).style.color = "white";
document.getElementById(cell).style.fontSize = "13px";
document.getElementById(cell).style.position = "relative";
document.getElementById(cell).style.top = "0px";
}



//the slide machines pics:
var slideShowSpeed = 5000               
var crossFadeDuration = 5

var Pic = new Array() 
Pic[0] = 'images/mach1.jpg'
Pic[1] = 'images/mach2.jpg'
Pic[2] = 'images/mach3.jpg'
Pic[3] = 'images/mach20.jpg'


var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++)
{
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow()
{
   if (document.all)
   {
      document.getElementById('SlideShow').style.filter="blendTrans(duration=2)"        
      document.getElementById('SlideShow').style.filter="blendTrans(duration=crossFadeDuration)"
      document.getElementById('SlideShow').filters.blendTrans.Apply()      
   }
   document.getElementById('SlideShow').src = preLoad[j].src
   if (document.all)
   {
      document.getElementById('SlideShow').filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}






//the sub_list of about:
/*
var i=-135;
var intHide;
var speed=3;

function onabout()
{
clearInterval(intHide);
intShow=setInterval("toshow()",10);
}

function outabout()
{
clearInterval(intShow);
intHide=setInterval("tohide()",10);
}


function toshow()
{
if (i<-12)
	{
	i=i+speed;
	document.getElementById('sub_list1').style.visibility='visible';
	}
}

function tohide()
{
if (i>-135)
	{
	i=i-speed;
	document.getElementById('sub_list1').style.visibility='hidden';
	}
}
*/

function onabout()
{
document.getElementById('list0').style.visibility='visible';
}

function outabout()
{

document.getElementById('list0').style.visibility='hidden';
	
}

function onprod()
{
document.getElementById('list1').style.visibility='visible';
}

function outprod()
{
document.getElementById('list1').style.visibility='hidden';
}



//the sub menu:
//working it when page load

window.onload= opa;

function opa()
{
document.getElementById("list0").style.opacity = "0.9";
document.getElementById("list0").style.filter = "alpha(opacity=90)";
document.getElementById("list1").style.opacity = "0.9";
document.getElementById("list1").style.filter = "alpha(opacity=90)";
}

//for about
function opa2()
{
document.getElementById("list1").style.opacity = "0.9";
document.getElementById("list1").style.filter = "alpha(opacity=90)";
}

//for products
function opa3()
{
document.getElementById("list0").style.opacity = "0.9";
document.getElementById("list0").style.filter = "alpha(opacity=90)";
}


//the on and out images
function oncell(cell)
{
cell.style.background = "#78B6FD";
cell.style.fontWeight = "bolder";
}

function outcell(cell)
{
cell.style.background = "#9FCCFF";
cell.style.opacity = "0.9";
cell.style.filter = "alpha(opacity=90)";
cell.style.fontWeight = "500";
}




//the Search box
function show_search()
{
document.getElementById('search_box').style.visibility = "visible";
}
function hide_search()
{
document.getElementById('search_box').style.visibility = "hidden";
}


function mysearch()
{
var key = document.getElementById('s_key').value;
	if(key == "")
	{
	alert("Write The Search Words");
	}
	else
	{
	window.open("http://www.google.com/search?sitesearch=www.cncleaders.com&as_q="+key ,"search")
	}
}



// correctly handle PNG transparency in Win IE 5 , 6

function fix_shadow() 
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}



//analysic
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-16924099-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
  
//]]>
