 
 Cufon.set('fontFamily', 'HelveticaNeueLTStd-BdCn');
 Cufon.replace('#subfooter h1');
   
  Cufon.replace('.splash_bucket_news h3');   
  

 
 Cufon.set('fontFamily', 'HelveticaNeueLTStd-Cn');

  Cufon.replace('#sub_content h1', {
    color: '-linear-gradient(0.1=#50bff3, 0.9=#048bcc)',
    textShadow: '1px 1px #ccc'
 }); 
 
  Cufon.replace('#contactcontainer h1', {
    color: '-linear-gradient(0.1=#50bff3, 0.9=#048bcc)',
    textShadow: '1px 1px #ccc'
 });
 
 
 
  Cufon.replace('.splash_bucket_news h2', {
    textShadow: '1px 1px #ccc'
  }); 

 
  Cufon.replace('#sub_content h2');
 
 
  Cufon.replace('#error h1', {

    textShadow: '1px 1px #ccc'
 });   

 Cufon.replace('.subnavmenu_item a');
 Cufon.replace('.subnavmenu_item_bottom a');
 
 Cufon.replace('ul.tabs li', {
    color: '-linear-gradient(0.1=#555, 0.8=#000)',
    fontFamily: 'HelveticaNeueLTStd-Cn',
    textShadow: '1px 1px #ccc'
 });
 
 Cufon.replace('ul.tabs li.active', {
    color: '-linear-gradient(0.1=#50bff3, 0.9=#048bcc)',  
    fontFamily: 'HelveticaNeueLTStd-Cn',
    textShadow: '1px 1px #ccc'
 }); 


 
 Cufon.replace('#sub_content_menu a', {
    fontWeight: '900'
 });

 
 Cufon.replace('#mainnav .navitema', {
    color: '-linear-gradient(0.1=#828282, 0.9=#3a3a3a)',
    fontFamily: 'HelveticaNeueLTStd-Cn',
    textShadow: '1px 1px #ccc'
 });
 

 $(document).ready(function() {     
     
     
     
 

            $(".pagerspan").click(function(){  
              alert('hello');
            });    
            
            
             
     
 // Submenus
 var navitems = new Array()  
 navitems['ourcompanynav'] = 'ourcompanysubnav';
 navitems['ourapproachnav'] = 'ourapproachsubnav';
 navitems['ourproductsnav'] = 'ourproductssubnav'; 
 navitems['ourgamesnav'] = 'ourgamessubnav'; 
 navitems['medianav'] = 'mediasubnav'; 
             
 
 // Our Company
 $('.navitem').hoverIntent(function() {
//  $('#ourcompanysubnav').fadeIn('fast');
    $('#'+navitems[$(this).attr("id")]).fadeIn('fast');
 }, function() {
//  $('#ourcompanysubnav').fadeOut('fast');
    $('#'+navitems[$(this).attr("id")]).fadeOut('fast');
 }); 
 
 // Tabs

    //When page loads...
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
    Cufon.refresh('#sub_content h2');                               

    //On Click Event
    $("ul.tabs li").click(function() {

        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        Cufon.refresh('ul.tabs li'); 
        Cufon.refresh('ul.tabs li.active'); 
        Cufon.refresh('#sub_content h2'); 
        $(".tab_content").hide(); //Hide all tab content

        var activeTab = $(this).attr("rel"); //Find the href attribute value to identify the active tab + content
        $('#'+activeTab).fadeIn(); //Fade in the active ID content  
        return false;
    });
    
    $(".tabletablink").click(function() {
      $('#multitab').click();
    });    


 // Modal Boxes

            $(".contactformlink").fancybox({  
                'width' : 1251,
                'height' : 636,
                'autoScale': false,
				'type' : 'iframe'
            });
			
			  $(".testbox").fancybox({  
                'width' : 50,
                'height' : 50,
                'autoScale': false,
				'type' : 'iframe'
            });
			  
			  $(".Q4video").fancybox({  
                'width' : 495,
                'height' : 425,
                'autoScale': false,
				'type' : 'iframe'
            });
			   $(".Highlight2011").fancybox({  
                'width' : 660,
                'height' : 400,
                'autoScale': false,
				'type' : 'iframe'
            });
     
     
// Controls The Toggle Function of The Sub Footer
     
  $("#openCloseIdentifier").hide();       
  $('#togglebutton').click(function() {
   if ($("#openCloseIdentifier").is(":hidden")) {   
    $("#subfooter").animate({
     height: "244px"
    }, 500, false, function() {
     $(".subfooter_box").fadeIn(1000); 
    } );
    $("#togglebutton").html('<img src="/assets/images/subfooter_clicktohidemenu.png" alt="Click To Hide Menu" />');                  
    $("#openCloseIdentifier").show();
   } else {
    $(".subfooter_box").fadeOut(1000, function() {
    $("#subfooter").animate({
     height: "33px"
    }, 500 ); 
    $("#togglebutton").html('<img src="/assets/images/subfooter_clicktoseemenu.png" alt="Click To Show Menu" />');                                   
    $("#openCloseIdentifier").hide();             
    });               
   }
  });
  
    $('#splash_banner_container').cycle({
        fx: 'fade',
        pager:  '#splashpager',
        timeout: 10000,
		before:BeforeCall,
		after:AfterCall
    });  
  
     $(".sub_content_menu_item").hover(
      function () {
      $(this).addClass("selected");
     },
     function () {
      $(this).removeClass("selected");
     });
	 
	 
	//if flash exists:
	if (navigator.mimeTypes ["application/x-shockwave-flash"] == undefined){
		$('#livedealerbanner_container').html(flashOne);	
		$('#slotsbanner_container').html(flashTwo);
		$('#tablegamesbanner_container').html(flashThree);
		$('#platformbanner_container').html(flashFour);
	}else{
		$('#livedealerbanner_container').html(flashOne);	
		$('#slotsbanner_container').html(flashTwo);
		$('#tablegamesbanner_container').html(flashThree);
		$('#platformbanner_container').html(flashFour);
	}
	//set bg image to beginning flash image
	//if flash not exist:
	//set bg image to end flash image
	
		 
	
	/*	$('#slotsbanner_container').flash(
			{
				swf: '/assets/flash/Chartwell_Slots_JTV01C.swf',
				width: 625,
				height: 430,
				play: true,
				wmode: 'transparent',
				expressInstall: true,
				loop:false
			});
		
		$('#tablegamesbanner_container').flash(
			{
				swf: '/assets/flash/Chartwell_TableGames_JTV01d.swf',
				width: 625,
				height: 430,
				play: false,
				wmode: 'transparent',
				expressInstall: true,
				loop:false
			});
		
		$('#livedealerbanner_container').flash(
			{
				swf: '/assets/flash/Chartwell_LiveDealers_JTV01c.swf',
				width: 625,
				height: 430,
				play: false,
				wmode: 'transparent',
				expressInstall: true,
				loop:false
			});
		
		$('#platformbanner_container').flash(
			{
				swf: '/assets/flash/Chartwell_Platform_JTV01C.swf',
				width: 625,
				height: 430,
				play: false,
				wmode: 'transparent',
				expressInstall: true,
				loop:false
			});		
*/
     
     
  
 });        
 
 
 function BeforeCall(currSlideElement, nextSlideElement, options, forwardFlag){
	 
	 $(".flashcontainer").each(function(){
			$(this).flash(
				function() {
					this.Play();
				}
			);}
 		);
 }
 
  function AfterCall(currSlideElement, nextSlideElement, options, forwardFlag){
	
	 $(".flashcontainer").each(function(){
			$(this).flash(
				function() {
					this.Play();
				}
			);}
 		);	
  }
 
 
