var newsSliderSpeed=800,newsSliderEasing="easeInOutExpo",newsSliderSelectIndex=0,newsSliderAniLeft="270px",ShowcaseIndex=0,mCtimout=4E3,mCanispeed=800,Mci=0,ShowcaseMid=0,HeadImgSelect=0,tic,tic_i,p_c,p_l,product,captions;
$(document).ready(function(){$.browser.msie&&$("#buyform .txtbox").css({width:"auto"});tic=$("#top_img_container");tic_i=$("#top_img_container img");if(pgeIndex==1){$("#quotebox").children("img").hide().eq(0).show();ShowcaseMid=$(".showcase_container").height()/2;$(".showcase_growbox").css({height:0,width:0,top:ShowcaseMid}).corner("10px").children(".showcase_section").hide().parent()}pgeIndex==4&&$(".newscontainer").html("<p>Refreshing news items...</p>");if(pgeIndex==2){$(".prodcontent").hide().eq(0).show();
product=$(".pi_thumbs img");captions=$(".ss_caption p");if(product.length>0){p_c=0;p_l=product.length-1;product.hide().eq(p_c).show();captions.hide().eq(p_c).show();$().everyTime(5E3,function(){if(p_c==p_l)p_c=0;else p_c++;product.fadeOut().eq(p_c).fadeIn();captions.fadeOut().eq(p_c).fadeIn()})}}pgeIndex==3&&$(".faq_content").hide().eq(0).show();if(pgeIndex==2||pgeIndex==3){$(".seeviewer").click(function(){selectindex=7;$(".prodcontent").hide().eq(selectindex).show();$(".faq_content").hide().eq(selectindex).show();
$(".productnav li").css("backgroundPosition","0px 0px").children("a").css("color","#666666");$(".productnav li").eq(selectindex).css("backgroundPosition","0px -66px").children("a").css("color","#fff")});$(".productnav li").eq(0).css("backgroundPosition","0px -66px").children("a").css("color","#fff");$(".productnav li").mouseover(function(){$(this).css("backgroundPosition")!="0px -66px"&&$(this).css("backgroundPosition","0px -33px")});$(".productnav li").mouseout(function(){$(this).css("backgroundPosition")!=
"0px -66px"&&$(this).css("backgroundPosition","0px 0px")});$(".productnav li a").click(function(){selectindex=$(".productnav li a").index(this);$(".prodcontent").hide().eq(selectindex).show();$(".faq_content").hide().eq(selectindex).show();$(".productnav li").css("backgroundPosition","0px 0px").children("a").css("color","#666666");$(".productnav li").eq(selectindex).css("backgroundPosition","0px -66px").children("a").css("color","#fff");$(".faq_content").eq(selectindex).children().children(".daqTabInfo").css({display:"none"}).eq(0).css({display:"block"});
$(".faq_content").eq(selectindex).children().children(".faqTabLst").children("li").children("a").removeClass("tabSelect").eq(0).addClass("tabSelect");return false});$(".product_radiobutton").click(function(){optionindex=$(".product_radiobutton").index(this);optionindex==2?$(".dropbox").eq(0).hide():$(".dropbox").eq(0).show()})}if(pgeIndex==5){$(".bluebox").draggable();$(".redbox").droppable({drop:function(){$(this).css("backgroundPosition","bottom");$(".bluebox").hide();$("#contactreturn").text("Processing...").show();
t1=$(".txtbox").eq(0).val();t2=$(".txtbox").eq(1).val();t3=$(".txtbox").eq(2).val();t4=$(".txtbox").eq(3).val();t5=$(".txtbox").eq(4).val();t6=$("#contactform .theHf").val();if(CheckEmail(t2)&&t1!=""&&t2==t3&&t6=="")$.post("scripts/php/contact.php",{f1:t1,f2:t2,f3:t3,f4:t4,f5:t5},function(a){$("#contactreturn").AnimateMessage(a);$(".txtbox").val("")});else{$("#contactreturn").AnimateMessage("Please enter your name and a valid email address.");$(".bluebox").css({top:83,left:154}).show();$(this).css("backgroundPosition",
"top")}}})}tic_i.css({opacity:0}).eq(0).css({opacity:1});$("a").click(function(){if($(this).attr("rel")=="nw")window.open($(this).attr("href"));else if($(this).attr("href")!="#"&&$(this).attr("href")!="")window.location=$(this).attr("href");return false});$(".showcase_section").eq(1).flash({src:"vids/sif.swf",width:440,height:260},{version:8});$(".showcase_section").eq(0).flash({src:"vids/pc440.swf",width:440,height:260},{version:8});pgeIndex==1&&$.post("scripts/php/news.php",{funcrequest:"newsslider"},
function(a){$("#hp_newsticker_inner").html(a);$(".hp_newsticker_sec").css("left",newsSliderAniLeft).eq(0).css("left","0px")});$("#contactform").submit(function(){return false});$("#cart").submit(function(){return false});$("#baf").submit(function(){thisVal=$("#baf .txtbox").val();CheckEmail(thisVal)?$.post("scripts/php/baf.php",{emailadd:thisVal,site:"PC"},function(a){$("#contactreturn").AnimateMessage(a)}):$("#contactreturn").AnimateMessage("Please enter a valid email address.");return false});$(".popC").css({zIndex:100}).children(".mask").animate({opacity:0},
{duration:0,queue:false}).parent().children(".diag").corner("5px cc:#303030").centreElm();$(window).bind("resize",function(){$(".popC .diag").centreElm()});$(document).keyup(function(a){a.keyCode==27&&$(".popC").children(".diag").css({display:"none"}).parent().children(".mask").animate({opacity:0},300,function(){$(this).parent().css({display:"none"})})});$(window).bind("load",function(){$(".popC .diag .closePop").click(function(){$(".popC").children(".diag").css({display:"none"}).parent().children(".mask").animate({opacity:0},
300,function(){$(this).parent().css({display:"none"})});return false});if(ProductIndex==6){$(".popC").css({display:"block"}).children(".mask").animate({opacity:0.8},{duration:300,queue:false});$(".popC .diag").centreElm()}$("#top_img_container").height($("#top_img_container").children("img").eq(0).height());$(".navlist li a").mouseover(function(){$(".navlist li a").index(this)==5?$("#pop_products").fadeIn(300):$("#pop_products").fadeOut(300)});$(".navlist li a").mouseout(function(){$(".navlist li a").index(this)!=
5&&$("#pop_products").fadeOut(300)});$(".faq_prodinfo").children(".faq_content").children("h3").click(function(){selectindex=$(".faq_prodinfo").children(".faq_content").children("h3").index(this);$(".faq_prodinfo").children(".faq_content").children(".faqanswer").eq(selectindex).slideToggle(300)});$(".daqTabInfo").eq(0).css({display:"block"});$(".faqTabLst li a").click(function(){thsIndex=$(this).parent().parent().children().children().index(this);$(this).parent().siblings("li").children("a").removeClass("tabSelect");
$(this).addClass("tabSelect");$(this).parent().parent().parent().children(".daqTabInfo").css({display:"none"}).eq(thsIndex).css({display:"block"});return false});$(".daqTabInfo h3").click(function(){selectindex=$(".daqTabInfo h3").index(this);$(".daqTabInfo .faqanswer").eq(selectindex).slideToggle(300)});$(".showcase_growbox").animate({width:444,height:280,top:0},600,newsSliderEasing,function(){$(this).children(".showcase_section").eq(0).fadeIn(300)});$(".arrow").hover(function(){ti=$(".arrow").index(this)+
1;tic_i.animate({opacity:0},{queue:false,duration:300}).eq(ti).animate({opacity:1},{queue:false,duration:500})},function(){tic_i.animate({opacity:0},{queue:false,duration:300}).eq(0).animate({opacity:1},{queue:false,duration:500})});pgeIndex==4&&$.post("scripts/php/news.php",{funcrequest:"newsfull"},function(a){$(".newscontainer").html(a);$(".newsitemcontent").hide();$(".newscontainer h3").click(function(){$(this).parent().children(".newsitemcontent").slideToggle(300)})});LoadVals()})});
$(function(){$.fn.ShwcaseAnimate=function(a,b){scSection=$(this).children(".showcase_section");scCount=scSection.size()-1;scSection.eq(ShowcaseIndex).fadeOut(300,function(){ShowcaseBoxAni(function(){scNextShow=ReturnNextInLine(scCount,a,ShowcaseIndex);scSection.eq(ShowcaseIndex).fadeOut(300);scSection.eq(scNextShow).fadeIn(300,function(){ShowcaseIndex=scNextShow;b!=undefined&&b()})})})};$.fn.NewsSlider=function(a,b){elementcount=$(this).children(".hp_newsticker_sec").size()-1;if(a=="left"){nStartPos=
"-"+newsSliderAniLeft;nAniOutPos=newsSliderAniLeft}else{nStartPos=newsSliderAniLeft;nAniOutPos="-"+newsSliderAniLeft}if(elementcount>0){$(this).children(".hp_newsticker_sec").css("left",nStartPos).eq(newsSliderSelectIndex).css("left","0px");nextAnimate=ReturnNextInLine(elementcount,a,newsSliderSelectIndex);NewsSliderAni(newsSliderSelectIndex,nextAnimate,$(this),nAniOutPos,".hp_newsticker_sec",function(){b!=undefined&&b()});newsSliderSelectIndex=nextAnimate}};$.fn.MyCycle=function(){imgcount=$(this).children("img").size()-
1;if(imgcount>0)if(Mci==imgcount){mCanimate(Mci,0,$(this));Mci=0}else{mCanimate(Mci,Mci+1,$(this));Mci++}};$.fn.AnimateMessage=function(a){$(this).text(a).fadeIn(300,function(){$(this).animate({opacity:1},3E3,function(){$(this).fadeOut(300)})})}});
(function(a){a.fn.extend({centreElm:function(b){b=a.extend({easing:"easeInOutExpo",aniSpeed:300},b);return this.each(function(){var c=b.easing,f=b.aniSpeed,d=a(this),e=d.height(),g=d.width(),h=a(window).height(),i=a(window).width();d.animate({top:h/2-e/2,left:i/2-g/2},{duration:f,easing:c,queue:false})})}})})(jQuery);function ShowcaseInter(){$(".showcase_container").animate({opacity:1},5E3,function(){$(".showcase_growbox").ShwcaseAnimate("left");ShowcaseInter()})}
function ShowcaseBoxAni(a){$(".showcase_growbox").animate({width:0,height:0,top:ShowcaseMid},600,newsSliderEasing,function(){$(this).animate({width:444,height:280,top:0},600,newsSliderEasing,function(){a!=undefined&&a()})})}function NewsSliderAni(a,b,c,f,d,e){c.children(d).eq(b).animate({left:"0px"},{duration:newsSliderSpeed,queue:false,easing:newsSliderEasing});c.children(d).eq(a).animate({left:f},newsSliderSpeed,newsSliderEasing,function(){e!=undefined&&e()})}
function mCanimate(a,b,c){c.animate({opacity:1},mCtimout,function(){$(this).children("img").eq(a).fadeOut(mCanispeed);$(this).children("img").eq(b).fadeIn(mCanispeed);c.MyCycle()})}function ReturnNextInLine(a,b,c){return b=="left"?c==0?a:c-1:c==a?0:c+1}function NewsTicker(){$("#hp_newsticker_inner").animate({opacity:1},mCtimout,function(){$(this).NewsSlider("right",function(){NewsTicker()})})}
function LoadVals(){$(".np_news_arrowleft").click(function(){$("#hp_newsticker_inner").stop().NewsSlider("left",function(){NewsTicker()});return false});$(".np_news_arrowright").click(function(){$("#hp_newsticker_inner").stop().NewsSlider("right",function(){NewsTicker()});return false});$(".showcasearrowleft").click(function(){$(".showcase_container").stop();$(".showcase_growbox").ShwcaseAnimate("left",function(){});return false});$(".showcasearrowright").click(function(){$(".showcase_container").stop();
$(".showcase_growbox").ShwcaseAnimate("right",function(){});return false});NewsTicker()}function CheckEmail(a){AtPos=a.indexOf("@");StopPos=a.lastIndexOf(".");return AtPos==-1||StopPos==-1?false:true};
