/* main nav for ie start */
	//detect if IE
  //if(document.getElementById('nav') != undefined){
			<!--//--><![CDATA[//><!--
			sfHover = function() {
				var sfEls = document.getElementById("nav").getElementsByTagName("LI");
				for (var i=0; i<sfEls.length; i++) {
					sfEls[i].onmouseover=function() {
						this.className+=" sfhover";
					};
					sfEls[i].onmouseout=function() {
						this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
					};
				};
			};
			if (window.attachEvent) window.attachEvent("onload", sfHover); 
			//alert("nav");
			//--><!]]>
//}
	/* main nav for ie end */
window.addEvent('domready', function() {

/* ========================= mootools - sub navi start ===================*/
	/*  sub vertival drop down start  */
	if (document.getElementById('sub_dd_in2') != undefined){
		var subVerticalSlide = document.getElementById('sub_dd_in2');
		if(subVerticalSlide){
			var myVerticalSlide2 = new Fx.Slide('sub_dd_in2').hide();
			var myVerticalSlide3 = new Fx.Slide('sub_dd_in3').hide();
			var myVerticalSlide4 = new Fx.Slide('sub_dd_in4').hide();
				$('sub_dd2').addEvent('click', function(e){
					e.stop();
					myVerticalSlide2.toggle();
					myVerticalSlide3.slideOut();
					myVerticalSlide4.slideOut();
				});
				$('sub_dd3').addEvent('click', function(e){
					e.stop();
					myVerticalSlide3.toggle();
					myVerticalSlide2.slideOut();
					myVerticalSlide4.slideOut();
				});
				$('sub_dd4').addEvent('click', function(e){
					e.stop();
					myVerticalSlide4.toggle();
					myVerticalSlide2.slideOut();
					myVerticalSlide3.slideOut();
				});
		};
	};
	/*  sub vertival drop down end  */
	/*  main vertival drop down start  */
	if (document.getElementById('main_dd_in1') != undefined){
		var mainVerticalSlide = document.getElementById('main_dd_in1');
		if(mainVerticalSlide){
			var myMainSlide1 = new Fx.Slide('main_dd_in1').show();
			var myMainSlide2 = new Fx.Slide('main_dd_in2').hide();
			if (document.getElementById('main_dd_in3') != undefined){
				var myMainSlide3 = document.getElementById('main_dd_in3');
				if (myMainSlide3){
					var mainSlide3 = new Fx.Slide('main_dd_in3').hide();
				};
			};
				var mainVertical4 = document.getElementById('main_dd_in4');
				if (mainVertical4 != undefined){
					var mainSlide4 = new Fx.Slide('main_dd_in4').hide();
				};
				var mainVertical5 = document.getElementById('main_dd_in5');
				if (mainVertical5 != undefined){
					var mainSlide5 = new Fx.Slide('main_dd_in5').hide();
				};
			
			$('main_dd1').addEvent('click', function(e){
				e.stop();
				myMainSlide1.toggle();
				myMainSlide2.slideOut();
				if(mainSlide3){
					mainSlide3.slideOut();
				}
				if(mainSlide4){
					mainSlide4.slideOut();
				}
				if(mainSlide5){
					mainSlide5.slideOut();
				}
			});
			$('main_dd2').addEvent('click', function(e){
				e.stop();
				myMainSlide2.toggle();
				myMainSlide1.slideOut();
				if(mainSlide3){
					mainSlide3.slideOut();
				}
				if(mainSlide4){
					mainSlide4.slideOut();
				}
				if(mainSlide5){
					mainSlide5.slideOut();
				}
			});
			if (document.getElementById('main_dd_in3') != undefined){
				$('main_dd3').addEvent('click', function(e){
					//var divId = document.getElementById('main_dd_in3');	
						//if (divId){
						e.stop();
						mainSlide3.toggle();
						myMainSlide2.slideOut();
						myMainSlide1.slideOut();
							if(mainSlide4){
								mainSlide4.slideOut();
							}
							if(mainSlide5){
								mainSlide5.slideOut();
							}
						//}
				 });
			};
			
			if (document.getElementById('main_dd_in4') != undefined){
					$('main_dd4').addEvent('click', function(e){
						//var divId = document.getElementById('main_dd_in4');
							//if (divId){
								e.stop();
								mainSlide4.toggle();
								mainSlide3.slideOut();
								myMainSlide2.slideOut();
								myMainSlide1.slideOut();
									if(mainSlide5){
										mainSlide5.slideOut();
									};
							//};
					});
			};
			if (document.getElementById('main_dd_in5') != undefined){
					$('main_dd5').addEvent('click', function(e){
						//var divId = document.getElementById('main_dd_in5');
						//if (divId){
							e.stop();
							mainSlide5.toggle();
							mainSlide4.slideOut();
							mainSlide3.slideOut();
							myMainSlide2.slideOut();
							myMainSlide1.slideOut();
						//};
					});
			}; 
		};
	};
	/*  main vertival drop down end  */
	/*  products drop down start  */
	if (document.getElementById('products_dd_in2') != undefined){
			var productsId1 = document.getElementById('products_dd_in1');
			if (productsId1){
				var productsSlide1 = new Fx.Slide('products_dd_in1').show();
			};
			var productsId2 = document.getElementById('products_dd_in2');
			if (productsId2){
				var productsSlide2 = new Fx.Slide('products_dd_in2').hide();
			};
			if (document.getElementById('products_dd_in3') != undefined){
				var productsId3 = document.getElementById('products_dd_in3');
				if (productsId3){
					var productsSlide3 = new Fx.Slide('products_dd_in3').hide();
				};
				var productsId4 = document.getElementById('products_dd_in4');
				if (productsId4){
					var productsSlide4 = new Fx.Slide('products_dd_in4').hide();
				};
			};
				$('products_dd1').addEvent('click', function(e){
					//var divId = document.getElementById('products_dd_in1');
					//if (divId){
						e.stop();
						productsSlide1.toggle();
						productsSlide2.slideOut();
						if (productsSlide3){
							productsSlide3.slideOut();
							productsSlide4.slideOut();
						};
					//};
				});
				$('products_dd2').addEvent('click', function(e){
					var divId = document.getElementById('products_dd_in2');
					if (divId){
						e.stop();
						productsSlide2.toggle();
						productsSlide1.slideOut();
						if (productsSlide3){
							productsSlide3.slideOut();
							productsSlide4.slideOut();
						};
					};
				});
				if (document.getElementById('products_dd_in3') != undefined)
				{
					$('products_dd3').addEvent('click', function(e){
						var divId = document.getElementById('products_dd_in3');
						if (divId){
							e.stop();
							productsSlide3.toggle();
							productsSlide4.slideOut();
							productsSlide2.slideOut();
							productsSlide1.slideOut();
						};
					});
					$('products_dd4').addEvent('click', function(e){
						var divId = document.getElementById('products_dd_in4');
						if (divId){
							e.stop();
							productsSlide4.toggle();
							productsSlide3.slideOut();
							productsSlide2.slideOut();
							productsSlide1.slideOut();
						};
					});
				};
		};
	/*  products drop down end  */
});
/* ========================= mootools - sub navi end ===================*/

/* ========================= nifty cube start  =========================*/

window.onload=function(){
	Nifty("div.container","transparent");
	Nifty("#sub_dd_in2","transparent bottom ");
	Nifty("#sub_dd_in3","transparent bottom ");
	Nifty("#sub_dd_in4","transparent bottom ");
	Nifty("#pop_contact","transparent ");
	Nifty("#pop_contact_done","transparent ");
	Nifty("#pop_share_done","transparent ");
	Nifty("#pop_share","transparent ");
	Nifty("#pop_how_to_buy","transparent ");
	Nifty("#pop_buy_this_now","transparent ");
	Nifty("#pop_joinnow","transparent "); // contest form - 2009 raya
	Nifty("#pop_joinnow_done","transparent "); // contest form - 2009 raya
	
	
}
/* ========================= nifty cube end  =========================*/



/* ========================= sub navi start  =========================*/
function openL1(divName){
	var clientWidth = 0;
	var clientHeight = 0;
	//alert(divName);
	clientHeight = document.documentElement.scrollHeight;
	clientWidth = document.documentElement.clientWidth;
	//alert(clientWidth);
  var divId = document.getElementById(divName);
  var divOverlay = document.getElementById('overlay');
  

	if(divId){
		centerPopups(divName);
		divOverlay.style.width = clientWidth + "px";
		divOverlay.style.height = clientHeight + "px";
		//divOverlay.style.height = scrollHeight + "px";
		
		
		divId.style.display     = "block";
		divId.style.zIndex      = 120;
		divOverlay.style.display  = "block";
		divOverlay.style.zIndex  = 100;
		//alert("height =" + divOverlay.style.height);
	}
}
function closeL1(divName){
	//alert(divName);
  	var divId = document.getElementById(divName);
	var divOverlay = document.getElementById('overlay');
	if(divId){
		divId.style.display     = "none";
		divId.style.zIndex      = 0;
		divOverlay.style.display     = "none";
		divOverlay.style.zIndex      = 0;
	}
}
function centerPopups(divName){
	/*var clientWidth = 0;
	var clientHeight = 0;
	//alert(divName);
	clientHeight = document.documentElement.scrollHeight;
	clientWidth = document.documentElement.clientWidth; */
		var div_Id = document.getElementById(divName);
		if (div_Id){
			//alert(document.documentElement.clientWidth);
     // div_Id.style.left = ( Math.round(document.documentElement.clientWidth/2) - 630) + "px";  //default 335
	 div_Id.style.left = "85px";  //default 335
			div_Id.style.top = "320px";
			//alert(clientWidth);
		}	
}

/* ========================= sub navi end  =========================*/