Cufon.replace('h4', {
	color: '-linear-gradient(#ffffff,#e4e4e3,#3d3d3d)',
	hover: {
		color: '#837870'
	}
});
Cufon.replace('a.topmenu', {
	color: '-linear-gradient(#ffffff,#e4e4e3,#3d3d3d)',
	hover: {
		color: '#837870'
	}
});

function showlang() { 

	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById('dropdown-lang').style.display = 'block'; 
	} 
}
function hidelang() { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
	document.getElementById('dropdown-lang').style.display = 'none'; 
	} 
}
function hasClass(ele,cls) {
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
 
function addClass(ele,cls) {
if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
 
function removeClass(ele,cls) {
if (hasClass(ele,cls)) {
var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
ele.className=ele.className.replace(reg,' ');
}
}
/***** Intialization Menu ******/
function initMenu(){
	timeout=0;
		$(".ddmenu").mouseenter(function(){
			clearTimeout(timeout);
			if(!$(this).find('.first').is(":visible")) {
			$(".ddmenu").find('.third').hide();
			$(".ddmenu").find('.second').hide();
			$(".ddmenu").find('.first').slideUp("fast");
			$(this).find('.first').slideDown("fast");
			}
		}).mouseleave(function(){
			thisobj=$(this);
			timeout=setTimeout(function()
        	 { 
           		thisobj.find('.third').hide(); 
				thisobj.find('.second').hide();
           		thisobj.find('.first').slideUp("fast");
				//alert(thisobj.find('.first').innerText());
         	  }, 500);
		});
		$('.first-li').click(function(){
			clearTimeout(timeout);
			$second=$(this).parent().find('.second');	
			$second.find('.third').hide(); 
			$second.slideToggle("fast");
								
		});
		$('.second-li').click(function(){
			clearTimeout(timeout);
			$third=$(this).parent().find('.third');
			$third.slideToggle("fast");
		});
}
/***** Intialization video ******/
function intvideo()
{
	$(".v").mouseenter(function(){
		$(this).find('.v-thumbnail').animate({opacity:1});
		$(this).find('.v-thumbnail').css('border','1px solid #ffffff');
		$(this).find('.caption').css('color','#CCC');
		$(this).css('cursor','pointer');
		});
	$(".v").mouseleave(function(){
		$(this).find('.v-thumbnail').animate({opacity:0.5});
		$(this).find('.v-thumbnail').css('border','1px solid #1c1c1c');
		$(this).find('.caption').css('color','#fff');
	});
}
/***** Intialization Wallpaper ******/
function intWallpaper(){
	var target;
	$(".ws-pw").click(function(){
		target=parseInt($(this).attr('rel'));
		
		$('.slideshow-w').cycle({
		fx:     'fade',
		speed:  'fast',
		timeout: 0,
		startingSlide:target,
		nowrap:true,
		next:   '#next',
		prev:   '#prev'
		});
		
		showOverlay('.wallpaper-w','.slideshow-container');
	});
	$(".s-pw").click(function(){
		target=parseInt($(this).attr('rel'));
		
		$('.slideshow-s').cycle({
		fx:     'fade',
		speed:  'fast',
		timeout: 0,
		startingSlide:target,
		nowrap:true,
		next:   '#next2',
		prev:   '#prev2'
		});
		
		showOverlay('.wallpaper-s','.slideshow-container');
	});
}

/***** Wallpaper Overlay ******/
function showOverlay(overlay,obj){ //pass in the overlay class name and the obj class on top
		$(overlay).fadeIn("slow",function() {
			$(obj).show();
			
			});
	}                                             
	function hideOverlay(overlay,obj){
		$(obj).hide();
		$(overlay).fadeOut("slow");
	}
/***** General Overlay ******/
function showCKOverlay(htmlcode){ 
		var content="";
		var c="";
		c=htmlcode.replace(/"/g, '\\"')
		
		content="<center>"+c+"</center>"
		
		$('.obj-container').html(content);
		$('.overlay').fadeIn("slow",function() {
			$('.obj-container').show();
			
		});
	}                                             
	function hideCKOverlay(){
		$('.overlay').hide();
		$('.obj-container').fadeOut("slow");
		var content ="";
        $(".obj-container").html(content);
	}
/***** YouTube Video Overlay ******/
function showYoutubeVideo(videoCode){
    	var content ="";
    	content += "<a href=\"#\" onclick=\"javascript:hideYoutubeVideo('#video-overlay');\"><div class=\"btn_close\"></div></a><div class=\"player\" align=\"center\"><object width=\"641\" height=\"392\"><param name=\"movie\" value=\"http://www.youtube.com/v/"+videoCode+"&fs=1&border=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/"+videoCode+"&fs=1&border=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"641\" height=\"392\"></embed></object></div>"
    	$('#video-overlay').html(content);
        	
		$('#video-overlay').fadeIn("slow",function() {
			$('.player').show();
			});
	}
	
function hideYoutubeVideo(){
	$('.player').hide();
	$('#video-overlay').fadeOut("slow");
	var content ="";
	$("#video-overlay").html(content);
}

/***** YouKu Video Overlay ******/
function showYoukuVideo(videoCode){
     var content ="";
     content += "<a href=\"#\" onclick=\"javascript:hideYoutubeVideo('#video-overlay');\"><div class=\"btn_close\"></div></a><div class=\"player\" align=\"center\"><object width=\"641\" height=\"392\"><param name=\"movie\" value=\"http://static.youku.com/v1.0.0150/v/swf/qplayer.swf?VideoIDS="+videoCode+"&embedid=-&showAd=0\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\""+videoCode+"\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"641\" height=\"392\"></embed></object></div>"

     $('#video-overlay').html(content);
         
  $('#video-overlay').fadeIn("slow",function() {
   $('.player').show();
   });
 }
		
/***** style guide page video thumbnail ******/	
function showvideothumb(videothumnail){
	$(videothumnail).show();
}
function hidevideothumb(videothumnail){
	$(videothumnail).hide();
}
/***** YouTube Video show on the same page - not overlay******/	
function CKvideoDisplay(video, title){
        $(".video-container").html("<iframe title=\"YouTube video player\" class=\"youtube-player\" type=\"text/html\" width=\"641\" height=\"392\" src=\"http://www.youtube.com/embed/"+video+"?rel=0\" frameborder=\"0\"></iframe><p class=\"v-ttl\">"+title+"</p>");
        return false;
    }
	
/***** YouKu Video show on the same page - not overlay******/	
function CKYouKuvideoDisplay(video1, title1){
        $(".video-container").html("<iframe title=\"YouKu video player\" class=\"youtube-player\" type=\"text/html\" width=\"641\" height=\"392\" src=\"http://static.youku.com/v1.0.0150/v/swf/qplayer.swf?VideoIDS="+video1+"&embedid=-&showAd=0\" frameborder=\"0\"></iframe><p class=\"v-ttl\">"+title1+"</p>");
        return false;
    }

/***** SHOW TOOLTIP EMAIL *****/
function showTooltipEmail(div_id1) {
	$(div_id1).css('display','block');
}

/***** SHOW TOOLTIP SEARCH *****/
function showTooltipSearch(div_id2) {
	$(div_id2).css('display','block');
}

/***** HIDE TOOLTIP *****/
function hideTooltip(div_id3) {
	$(div_id3).css('display','none');
}
