﻿//open new window
function openWin(URL,width,height,scroll,menubar,toolbar,resize,xPos,yPos,winName,locationbar){
	var focusFail = false;
	if (width == "") width = "500";
	if (height == "") height = "500";
	if (scroll == "") scroll = "auto";
	if (menubar =="") menubar = "no";
	if (toolbar == "") toolbar = "no";
	if (resize == "") resize = "yes";
	if (xPos == "") xPos = "5";
	if (yPos == "") yPos = "5";
	if (winName == "") winName = "win";
	if (locationbar == "") locationbar = "0";
	var features ="width=" +width+ ",height=" +height+ ",scrollbars=" +scroll+ ",menubar=" +menubar+ ",toolbar=" +toolbar+ ",resizable=" +resize+ ",left=" +xPos+ ",top=" +yPos+",location="+locationbar;
	var newWin = window.open(URL,winName,features);
	if (navigator.appVersion.indexOf("NT")!= -1){
		if (navigator.appVersion.indexOf("NT 5")!= -1){
			focusFail = false;
		} else if (ie4 == true)	focusFail = true;
	}
	if (focusFail == false){
		if (window.focus) newWin.focus();
	}
}

$(document).ready(function(){

/* au home right marqee*/
$("#au_marquee_CarouselLite").jCarouselLite({
    btnNext: "#left_button",
    btnPrev: "#right_button",
	visible :1,
	scroll :1,
	speed: 1000
});

/*au left nav show , hidden */
$(".au_left_nav_content").hide(); 

/*$("#au_left_nav").mouseout(function(){
	$(".au_left_nav_title").removeClass("title_rollover");
	$(".au_left_nav_content").hide();
	}
);*/

/*$(".au_left_nav_title").mouseover(function(){
	var $nextDiv = $(this).next('.au_left_nav_content');
    var isShow = $(this).next(".au_left_nav_content").is(':visible');	
	var $siblingsContentDiv = $nextDiv.siblings(".au_left_nav_content");
	if($siblingsContentDiv.length ){
		$siblingsContentDiv.slideUp("slow");
	} else {
	}
	if(isShow){
	} else {
	$(this).addClass("title_rollover");
	$nextDiv.slideDown("slow");
	}
});*/
var config = {    
     sensitivity: 1,  
     interval: 100,   
     over: au_left_nav_mouserover,  
     timeout: 100,    
     out: au_left_nav_mouserout   
};

$(".au_left_nav_single").hoverIntent(config);

function au_left_nav_mouserover(){
$(this).children(".au_left_nav_title").addClass("title_rollover");
$(this).children(".au_left_nav_content").slideDown("slow");
}
function au_left_nav_mouserout(){
$(this).children(".au_left_nav_title").removeClass("title_rollover");
$(this).children(".au_left_nav_content").slideUp("slow");
}




$("#au_title_logo").click(function(){
	window.open("http://www.intel.com/cd/channel/australia/apac/eng/home/index.htm ",'_self','');
});

$("#au_left_nav #au_left_nav_titlet_1").click(function(){
    window.open("http://www.intel.com/cd/channel/australia/apac/eng/home/membershub/index.htm",'_self','');
});
$("#au_left_nav #au_left_nav_titlet_2").click(function(){
    window.open("http://intelletstalkbiz.com/forms/marketingtoolbox",'_self','');
});
$("#au_left_nav #au_left_nav_titlet_3").click(function(){
    window.open("http://www.intel.com/cd/channel/australia/apac/eng/home/salestools/index.htm",'_self','');
});
$("#au_left_nav #au_left_nav_titlet_4").click(function(){
    window.open("http://retailadvantage.intel.com/login.cfm",'_blank','');
});

/*home talk to us tab, mouse over, out, click*/
$("#au_home_member_content").hide();
$("#au_home_yoursay_content").hide();
$("#au_home_needhelp_content").hide();

$("#au_home_talkus_tab_poll").hover(
	function(){
	$(this).addClass("au_home_talkus_tab_poll_rollover");
	},
	function(){
	$(this).removeClass("au_home_talkus_tab_poll_rollover");
	}
);
$("#au_home_talkus_tab_member").hover(
	function(){
	$(this).addClass("au_home_talkus_tab_member_rollover");
	},
	function(){
	$(this).removeClass("au_home_talkus_tab_member_rollover");
	}
);
$("#au_home_talkus_tab_yoursay").hover(
	function(){
	$(this).addClass("au_home_talkus_tab_yoursay_rollover");
	},
	function(){
	$(this).removeClass("au_home_talkus_tab_yoursay_rollover");
	}
);
$("#au_home_talkus_tab_needhelp").hover(
	function(){
	$(this).addClass("au_home_talkus_tab_needhelp_rollover");
	},
	function(){
	$(this).removeClass("au_home_talkus_tab_needhelp_rollover");
	}
);

$("#au_home_talkus_tab_poll").click(function(){
	$(this).addClass("au_home_talkus_tab_poll_active");
	$("#au_home_talkus_tab_member").removeClass("au_home_talkus_tab_member_acitve");
	$("#au_home_talkus_tab_yoursay").removeClass("au_home_talkus_tab_yoursay_acitve");
	$("#au_home_talkus_tab_needhelp").removeClass("au_home_talkus_tab_needhelp_acitve");
	$("#au_home_poll_content").show();
	$("#au_home_member_content").hide();
	$("#au_home_yoursay_content").hide();
	$("#au_home_needhelp_content").hide();
	}
);
$("#au_home_talkus_tab_member").click(function(){
	$(this).addClass("au_home_talkus_tab_member_acitve");
	$("#au_home_talkus_tab_poll").removeClass("au_home_talkus_tab_poll_active");
	$("#au_home_talkus_tab_yoursay").removeClass("au_home_talkus_tab_yoursay_acitve");
	$("#au_home_talkus_tab_needhelp").removeClass("au_home_talkus_tab_needhelp_acitve");
	$("#au_home_poll_content").hide();
	$("#au_home_member_content").show();
	$("#au_home_yoursay_content").hide();
	$("#au_home_needhelp_content").hide();
	}
);
$("#au_home_talkus_tab_yoursay").click(function(){
	$(this).addClass("au_home_talkus_tab_yoursay_acitve");
	$("#au_home_talkus_tab_poll").removeClass("au_home_talkus_tab_poll_active");
	$("#au_home_talkus_tab_member").removeClass("au_home_talkus_tab_member_acitve");
	$("#au_home_talkus_tab_needhelp").removeClass("au_home_talkus_tab_needhelp_acitve");
	$("#au_home_poll_content").hide();
	$("#au_home_member_content").hide();
	$("#au_home_yoursay_content").show();
	$("#au_home_needhelp_content").hide();
	}
);
$("#au_home_talkus_tab_needhelp").click(function(){
	$(this).addClass("au_home_talkus_tab_needhelp_acitve");
	$("#au_home_talkus_tab_poll").removeClass("au_home_talkus_tab_poll_active");
	$("#au_home_talkus_tab_member").removeClass("au_home_talkus_tab_member_acitve");
	$("#au_home_talkus_tab_yoursay").removeClass("au_home_talkus_tab_yoursay_acitve");
	$("#au_home_poll_content").hide();
	$("#au_home_member_content").hide();
	$("#au_home_yoursay_content").hide();
	$("#au_home_needhelp_content").show();
	}
);

/*au home talk us tab member register button*/
$("#au_home_member_register").hover(
	function(){
	$(this).addClass("au_home_member_register_rollover");
	},
	function(){
	$(this).removeClass("au_home_member_register_rollover");
	}
);

/*au home poll radio*/

$(".au_radio #au_radio_online").click(function(){
	$(this).addClass("au_radio_pointer_active");
	$("#au_radio_Email").removeClass("au_radio_pointer_active");
	$("#au_radio_Posters").removeClass("au_radio_pointer_active");
	$("#au_radio_Screensavers").removeClass("au_radio_pointer_active");	
	$("input[@name='poll_radio']")[0].checked="true";
});
$(".au_radio #au_radio_Email").click(function(){
	$(this).addClass("au_radio_pointer_active");
	$("#au_radio_online").removeClass("au_radio_pointer_active");
	$("#au_radio_Posters").removeClass("au_radio_pointer_active");
	$("#au_radio_Screensavers").removeClass("au_radio_pointer_active");	
	$("input[@name='poll_radio']")[1].checked="true";	
});
$(".au_radio #au_radio_Posters").click(function(){
	$(this).addClass("au_radio_pointer_active");
	$("#au_radio_online").removeClass("au_radio_pointer_active");
	$("#au_radio_Email").removeClass("au_radio_pointer_active");
	$("#au_radio_Screensavers").removeClass("au_radio_pointer_active");	
	$("input[@name='poll_radio']")[2].checked="true";	
});
$(".au_radio #au_radio_Screensavers").click(function(){
	$(this).addClass("au_radio_pointer_active");
	$("#au_radio_online").removeClass("au_radio_pointer_active");
	$("#au_radio_Email").removeClass("au_radio_pointer_active");
	$("#au_radio_Posters").removeClass("au_radio_pointer_active");
	$("input[@name='poll_radio']")[3].checked="true";	
});

$("#testradiovalue").click(function(){
	alert($("input[name='poll_radio'][type='radio']:checked").val());
});

/*au home vote*/
$("#au_radio_vote").hover(
	function(){
	$(this).addClass("au_radio_vote_active");
	},
	function(){
	$(this).removeClass("au_radio_vote_active");
	}
);

/*au home have your say*/
$("#au_home_yoursay_submit").hover(
	function(){
	$(this).addClass("au_home_yoursay_submit_active");
	},
	function(){
	$(this).removeClass("au_home_yoursay_submit_active");
	}
);
/*sale tale page function*/
/*tab mouse over , out , click*/
$("#au_tab_videos_content").hide();
$("#au_tab_smalbiz_content").hide();
	
$("#au_tab_sales").hover(
	function(){
	$(this).addClass("au_tab_sales_rollover");
	},
	function(){
	$(this).removeClass("au_tab_sales_rollover");
	}
);
$("#au_tab_videos").hover(
	function(){
	$(this).addClass("au_tab_videos_rollover");
	},
	function(){
	$(this).removeClass("au_tab_videos_rollover");
	}
);
$("#au_tab_smalbiz").hover(
	function(){
	$(this).addClass("au_tab_smalbiz_rollover");
	},
	function(){
	$(this).removeClass("au_tab_smalbiz_rollover");
	}
);

$("#au_tab_sales").click(function(){
	$(this).addClass("au_tab_sales_active");
	$("#au_tab_videos").removeClass("au_tab_videos_active");
	$("#au_tab_smalbiz").removeClass("au_tab_smalbiz_active");
	$("#au_tab_sales_content").show();
	$("#au_tab_videos_content").hide();
	$("#au_tab_smalbiz_content").hide();
	}
);
$("#au_tab_videos").click(function(){
	$(this).addClass("au_tab_videos_active");
	$("#au_tab_sales").removeClass("au_tab_sales_active");
	$("#au_tab_smalbiz").removeClass("au_tab_smalbiz_active");
	$("#au_tab_sales_content").hide();
	$("#au_tab_videos_content").show();
	$("#au_tab_smalbiz_content").hide();
	}
);
$("#au_tab_smalbiz").click(function(){
	$("#au_tab_sales").removeClass("au_tab_sales_active");
	$("#au_tab_videos").removeClass("au_tab_videos_active");
	$(this).addClass("au_tab_smalbiz_active");
	$("#au_tab_sales_content").hide();
	$("#au_tab_videos_content").hide();
	$("#au_tab_smalbiz_content").show();
	}
);

/*left content (sign up) mouse over, out, click*/
$("#au_sign_content").hide();
	
$("#au_sing_up").hover(
	function(){
	$(this).addClass("au_sign_up_now_rollover");
	},
	function(){
	$(this).removeClass("au_sign_up_now_rollover");
	}
);
/*$("#au_sing_up").click(function(){
	$(this).addClass("au_sign_up_now_active");
	$("#au_sign_content").empty();
	$("#au_sign_content").append("<iframe height='478px' frameborder='0' width='484px' src='http://www.intel.com/apac/channel/Australia/Final_Slider/final.htm'></iframe>");
	$("#au_sign_content").show();
	$("#au_saletool_top").hide();
	$("#au_saletool_content").hide();
	}
);*/
$("#au_sing_up").click(function(){
    window.open("http://intelletstalkbiz.com/forms/registration",'_self','');
});

/*left content top tool, click*/
$("#au_top_tool_content").hide();
$("#au_top_tool").toggle(function(){
	$(this).addClass("au_top_tool_rollover");
	}, function () {
	$(this).removeClass("au_top_tool_rollover");
});


$("#au_top_tool").click(function(){
	$("#au_top_tool_content").slideToggle('slow');
	}
);

$("#au_top_promotion_content").hide();
$("#au_top_promotion").toggle(function(){
	$(this).addClass("au_top_promotion_rollover");
	}, function () {
	$(this).removeClass("au_top_promotion_rollover");
});


$("#au_top_promotion").click(function(){
	$("#au_top_promotion_content").slideToggle('slow');
	}
);

/*middle sales content , mouse over, out*/

$('.au_sales_line_content').hide();
$('.au_sales_line').click(function() {
	var $nextDiv = $(this).next('.au_sales_line_content');
	var isShow = $nextDiv.is(':visible');	
	$('.au_sales_line').removeClass('au_sales_line_rollover');
	$('.au_sales_line_content:visible').slideUp("slow");
	if(isShow){
		$(this).removeClass("au_sales_line_rollover");
	} else {
		$(this).addClass("au_sales_line_rollover");
		$nextDiv.slideDown("slow");		
	}	
});


/*middle content video, click to open new player window*/
$("#au_video1").click(function(){
openWin('http://www.intel.com/apac/channel/Australia/potal/video/au_video1.htm','600', '500', 'no', 'no', 'no','yes','200px','50px','au_video1');
})
$("#au_video2").click(function(){
openWin('http://www.intel.com/apac/channel/Australia/potal/video/au_video2.htm','600', '500', 'no', 'no', 'no','yes','200px','50px','au_video2');
})
$("#au_video3").click(function(){
openWin('http://www.intel.com/apac/channel/Australia/potal/video/au_video3.htm','600', '500', 'no', 'no', 'no','yes','200px','50px','au_video3');
})
$("#au_video4").click(function(){
openWin('http://www.intel.com/apac/channel/Australia/potal/video/au_video4.htm','600', '500', 'no', 'no', 'no','yes','200px','50px','au_video4');
})
$("#au_video5").click(function(){
openWin('http://www.intel.com/apac/channel/Australia/potal/video/au_video5.htm','600', '500', 'no', 'no', 'no','yes','200px','50px','au_video5');
})
$("#au_video6").click(function(){
openWin('http://www.intel.com/apac/channel/Australia/potal/video/au_video6.htm','600', '500', 'no', 'no', 'no','yes','200px','50px','au_video6');
})

$("#au_video_game1").click(function(){
	window.open("http://itmanager3.intel.com/en-us/default.aspx",'_blank','');
});

/*member hub*/
$("#au_top_tool_Promotional_content").hide();
$("#au_top_tool_Sales_content").hide();
$("#au_top_tool_point_content").hide();

$('#au_home_top_Promotional').click(function() {
	var $nextDiv = $('#au_top_tool_Promotional_content');
	var isShow = $nextDiv.is(':visible');	
	
	$("#au_home_top_Sales").removeClass('au_home_top_Sales_rollover');
	$("#au_home_top_point").removeClass('au_home_top_point_rollover');	
	$("#au_top_tool_Sales_content:visible").slideUp("slow");
	$("#au_top_tool_point_content:visible").slideUp("slow");
	
	$nextDiv.slideUp("slow");
	
	if(isShow){
		$(this).removeClass("au_home_top_Promotional_rollover");
	} else {
		$(this).addClass("au_home_top_Promotional_rollover");
		$nextDiv.slideDown("slow");		
	}	
});

$('#au_home_top_Sales').click(function() {
	var $nextDiv = $('#au_top_tool_Sales_content');
	var isShow = $nextDiv.is(':visible');	
	
	$("#au_home_top_Promotional").removeClass('au_home_top_Promotional_rollover');
	$("#au_home_top_point").removeClass('au_home_top_point_rollover');	
	$('#au_top_tool_Promotional_content:visible').slideUp("slow");
	$('#au_top_tool_point_content:visible').slideUp("slow");
	$nextDiv.slideUp("slow");
	
	if(isShow){
		$(this).removeClass("au_home_top_Sales_rollover");
	} else {
		$(this).addClass("au_home_top_Sales_rollover");
		$nextDiv.slideDown("slow");		
	}	
});

$('#au_home_top_point').click(function() {
	var $nextDiv = $('#au_top_tool_point_content');
	var isShow = $nextDiv.is(':visible');	
	
	$("#au_home_top_Sales").removeClass('au_home_top_Sales_rollover');
	$("#au_home_top_Promotional").removeClass('au_home_top_Promotional_rollover');	
	$('#au_top_tool_Sales_content:visible').slideUp("slow");
	$('#au_top_tool_Promotional_content:visible').slideUp("slow");
	$nextDiv.slideUp('slow');
	
	if(isShow){
		$(this).removeClass("au_home_top_point_rollover");
	} else {
		$(this).addClass("au_home_top_point_rollover");
		$nextDiv.slideDown('slow');	
	}	
});

});
