		var slidediv = 1;
		var horizontal_holder = 1;
		var vertical_holder = 1;
		var news_holder = 1;
		var position = 'left';
		var gallery_slide = 1;
		var actualListPos = 1;
		var bufferingStopped1 = false;
		var oldfilm = "";
		var menuSlide = 0;
		var menu_moveddown = 0;	
			
		function topslideUp(){
			//$('#top1').fadeOut('fast');
			$('#top1').slideUp('slow');
			
			//$('#top3').fadeOut('fast');
			$('#top3').slideUp('slow');			
			
			menupos = $("#slidemenu1").offset().top;
			
			$('#theTopClose').css('display','none');
			
			
			newmenupos = menupos - 190;
			//actualmenupos = newmenupos + 'px';
			
			
			if (menupos > 400) {
				$("#slidemenu1").stop(true, true).animate({
					marginTop: '570px'
				}, 'slow');
			}
			
			else{
				$("#slidemenu1").stop(true, true).animate({
					marginTop: '140px'
				}, 'slow');
				
			}
			
			
			for(i = 0; i <= 5; i++){
				
				oldmenuname = "#topm" + i;
				$(oldmenuname).css({
				backgroundColor: '#5F604B',
				color: '#fff'
			})
					
			}
		}
		
		function trackPageView(theURL)
		{
			  var _gaq = _gaq || [];
			  _gaq.push(['_setAccount', 'UA-1204854-1']);
			  _gaq.push(['_trackPageview',theURL]);
			
			  (function() {
			    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			  })();
		
		
		}
		
		
		
		function topperspectus(num){
			
					
			if(num == 1){
				 $("#tp1").css({
					backgroundColor: '#5F604B',
					color: '#fff'
			
				})
				
				$("#tp2").css({
					backgroundColor: '#EDECE9',
					color: '#5F604B'
			
				})
				
			}
			
			else{
				$("#tp1").css({
					backgroundColor: '#EDECE9',
					color: '#5F604B'
			
				})
				
				$("#tp2").css({
					backgroundColor: '#5F604B',
					color: '#fff'
			
				})
			
			}
				
		}

		function topbit(divid){
					
			if (fxque()) {
				area = divid;
				menupos = $("#slidemenu1").offset().top;
				
				if(area == 3){
					lHeight = 100;
				}
				else{
					lHeight = 190;
				}
				
				
				newmenupos = menupos + lHeight;
				actualmenupos = newmenupos + 'px';
			
			
				if (area == 3) {
			
	
					if (menupos > 400) {
						$("#slidemenu1").stop(true, true).animate({
							marginTop: '650px'
						}, 'slow');
					}
					
					else {
						$("#slidemenu1").stop(true, true).animate({
							marginTop: '240px'
						}, 'slow');
						
					}
				}
				
				else{
				
					if (menupos > 400) {
						$("#slidemenu1").stop(true, true).animate({
							marginTop: '740px'
						}, 'slow');
					}
					
					else{
						$("#slidemenu1").stop(true, true).animate({
							marginTop: '330px'
						}, 'slow');
						
					}
				}
			
				
				
				topmenuname = "#topm" + area;
				
				for (i = 0; i <= 5; i++) {
					if (i != area) {
						oldmenuname = "#topm" + i;
						$(oldmenuname).css({
							backgroundColor: '#5F604B',
							color: '#fff'
						})
					}
				}
				
				
				$(topmenuname).css({
					backgroundColor: '#fff',
					color: '#5F604B'
				})
				
				
				if (area == 3) {
					$('#top1').css({
						height: '100px'
					});
					
					$('#top3').css({
						height: '100px'
					});
				}
				else{
					$('#top1').css({
						height: '190px'
					});	
					
					$('#top3').css({
						height: '190px'
					});
					
				}		
				
				
				$('#top1').stop(true, true).slideDown('slow');
				$('#top3').stop(true, true).slideDown('slow');

				for(i=1; i<=4;i++){ 		
					divloopname = '#topbit' + i;
					$(divloopname).css({display:'none'});	
				 }

				divname = '#topbit' + divid;
				$(divname).css({
					display: 'block'
				});	
				
				
				if (divid == 3)
				{
				 $('#theTopClose').css('padding-top','60px');
				}
				else
				{
				 $('#theTopClose').css('padding-top','160px');
				}
				
				
					
					$('#theTopClose').css('display','');
					
					
			}
	
		}
	
		function sidearrows(depth){
				
		
			if(depth <  1){
				$('.fixed_holder').fadeIn('fast');
			}
			else{
				$('.fixed_holder').fadeOut('fast');
			}
	 	
		}
		
		function ajaxcall(position, contentid, siteid,news_id,highlight_id,k_19){
		
			if (fxque()){
		
				if (slidediv == 1) {
					slidediv = 2;
					
					currentdiv = '#slide1';
					newdiv = '#slide2';
				}
				
				else {
					slidediv = 1;
					currentdiv = '#slide2';
					newdiv = '#slide1';
				}
					
				horizontal_holder=1;			
				verticle_holder = 1;
				
				switch (position) {
					case 'down':
						newposition = 'up';
						break;
						
					case 'up':
						newposition = 'down';
						break;
						
					case 'left':
						newposition = 'right';
						break;
						
					case 'right':
						newposition = 'left';
						break;
				}
				
				$('#loading').css( {display: 'block'});
				
				$(currentdiv).stop(true, true).hide("slide", {
					direction: newposition
				}, 'slow');
				
				
				
				//hightlite menue;
				menuName = '#nav_holder_' + contentid;
			
				$('.nav_holder_on').removeClass('nav_holder_on').addClass('nav_holder');
				$('.nav_holder_end_on').removeClass('nav_holder_end_on').addClass('nav_holder_end');
				

				if ($(menuName).hasClass("nav_holder_end"))
				{
				 $(menuName).removeClass('nav_holder_end').addClass('nav_holder_end_on');
				}
				else
				{
				 $(menuName).removeClass('nav_holder').addClass('nav_holder_on');
				}
				
				
				// move the main menu bar

				slide_menu();
				
				
				$.ajax({
					type: "get",
					url: "/cfc/remote.cfc",
					data: {
						method: "fncPage",
						returnFormat: 'json',
						contentid: contentid,
						main_site: siteid,
						news_id:news_id,
						k_19:k_19
					
					},
					
					dataType: "json",
					
					
					success: function(r){
						$(currentdiv).html(' ');
						$(newdiv).html(r.HELLO);
							
						jQuery(document).ready(function () {
							$(this).attr('title',r.METATITLE);
						});	
						
						$(newdiv).stop(true, true).show("slide", {
						 direction: position
						 }, 'slow', function(){
						
							setTimeout('colresize()',1000);
							
						
							
							// sort out div height
							newHozDiv = newdiv + ' > #horizontal_holder1 > #verticle_holder1 > #col1';
							newHeight1 = $(newHozDiv).height();
						
							//$('#printbut').click(function() {showprintdialog("/"+r.SEOURL+"-"+contentid+"-print.html")};
							
							
					
							if(newHeight1 <= 400){
								newHeight1 = 400;	
							}
							else{
								newHeight1 =  newHeight1 + 40;	
							}
							
							$(newdiv).height(newHeight1);
							
							$(newdiv +' > #horizontal_holder1').height(newHeight1);
							$(newdiv +' > #horizontal_holder1 > #verticle_holder1').height(newHeight1);		
							footercontent(newHeight1);
							
						
							if (highlight_id == null)
							{
							
							 $($('.innermenu_horizontal_1')[0]).removeClass('innermenu_horizontal_1').addClass('innermenu_horizontal_up');
							
							}
							else
							{
							 menuName = '#innermenu_horizontal_1_' + highlight_id;
					
							 $('.innermenu_horizontal_up').removeClass('innermenu_horizontal_up').addClass('innermenu_horizontal_1');
							 $(menuName).removeClass('innermenu_horizontal_1').addClass('innermenu_horizontal_up');
							}
							
							$('#loading').css( {display: 'none'});
							
							printbutton(contentid,r.SEOURL);
									
							if (r.ISNEWS == 0)
							{
							 c = "/"+contentid+"-"+r.SEOURL+".html";
							 trackPageView(c);
							 globalhash = contentid;
							  location.hash = contentid;
							}
							else
							{
							 c = "/"+contentid+"-"+r.LISTINGSEOURL+"/"+r.SEOURL+"-"+news_id+".html";
							trackPageView(c);
							globalhash =  contentid+"I"+news_id;
							 location.hash = contentid+"I"+news_id;
							}
								
						});
						
					},
					
					error: function(r, strError){
					//alert(strError)
					}
					
				});
				
			}
		}
		

				
				
				
		function horizonal_contentcall(position,contentid,siteid,lastid,catid,pageno,month1,year1,day1)	{
				
				
				if (fxque()) {
					
					globalhash = contentid;
					location.hash = contentid;
					
					if (slidediv == 1) {			
						currentSdiv = '#slide1';
						newSdiv = '#slide2';
					}
					
					else {
						currentSdiv = '#slide2';
						newSdiv = '#slide1';
					}
					
					if (horizontal_holder == 1) {
						horizontal_holder = 2;
						
						currentHdiv = '#horizontal_holder1';
						newHdiv = '#horizontal_holder2';
						
					}
					
					else {
						horizontal_holder = 1;
						currentHdiv = '#horizontal_holder2';
						newHdiv = '#horizontal_holder1';
					}

			
					currentdiv = currentSdiv + ' > ' + currentHdiv ;
					newdiv = currentSdiv + ' > ' + newHdiv;	
					
						
								
					newVerticle = newdiv + ' > #verticle_holder1 > #col1';
					
					
					if (lastid == null)
					{	
					
					menuName = '#innermenu_horizontal_1_' + contentid;
					
					$('.innermenu_horizontal_up').removeClass('innermenu_horizontal_up').addClass('innermenu_horizontal_1');
					$(menuName).removeClass('innermenu_horizontal_1').addClass('innermenu_horizontal_up');
					
					
					}
				
											
					switch (position) {
					
						case 'left':
							newposition = 'right';
							break;
							
						case 'right':
							newposition = 'left';
							break;
					}
					
					
					$(currentdiv).stop(true, true).hide("slide", {
						direction: newposition
					}, 1000);
					
					$('#loading').css( {display: 'block'});
					
					$.ajax({
						type: "get",
						url: "/cfc/remote.cfc",
						data: {
							method: "fncPage",
							returnFormat: 'json',
							contentid: contentid,
							main_site: siteid,
							catid:catid,
							pageno:pageno,
							month1:month1,
							year1:year1,
							day1:day1,
							innertype: 1
						
						},
						
						dataType: "json",

						success: function(r){
							$(currentdiv).html('');
							$(newdiv).html(r.HELLO);
							
							jQuery(document).ready(function () {
								$(this).attr('title',r.METATITLE);
							});	
							

							$(newdiv).stop(true, true).show("slide", {
								direction: position
								}, 1400, function(){
							
								vertical_holder = 1;
								setTimeout('colresize()',1000);
					
						
								newHeight1 = $(newVerticle).height();
							
								if(newHeight1 <= 400){
									newHeight1 = 400;	
								}
								else{
	
									if(newHeight1 <= 400){
										newHeight1 = 400;	
									}
									
									else{
										newHeight1 =  newHeight1 + 40;	
									
									}
								}
								
								//alert(newHeight1)
								
								$('.slidediv').height(newHeight1);
								
								$(newdiv).height(newHeight1);
								
								$(newdiv + ' > #verticle_holder1').height(newHeight1);
								//alert(newHeight1)
								footercontent(newHeight1);
								
								$('#loading').css( {display: 'none'});
								printbutton(contentid,r.SEOURL);
								
							
								 c = "/"+r.SEOURL+"-"+contentid+".html";
								 trackPageView(c);

								
								
								
							});
						},
								
						
						error: function(r, strError){
						//alert(strError)
						}
						
					});
				}
		   	}
				
			
	
		
		
		function vertical_contentcall(position, contentid, siteid){
			if (fxque()) {
	
				globalhash = contentid;
				location.hash = contentid;
				
				if (slidediv == 1) {
					slider1 = '#slide1 >';
				}
				
				else {
					slider1 = '#slide2 >';
				}
					
				
				if (vertical_holder == 1) {
					vertical_holder = 2;
					vertdiv1 = '#verticle_holder1';
					vertdiv2 = '#verticle_holder2';
				}
				
				else {
					vertical_holder = 1;
					vertdiv1 = '#verticle_holder2';
					vertdiv2 = '#verticle_holder1';
					
				}

				
				if (horizontal_holder == 1) {
					hozdiv = '#horizontal_holder1 >';
				}
				
				else {
					hozdiv = '#horizontal_holder2 >';
				}
				
				
				currentdiv = slider1 + hozdiv + vertdiv1;
				newdiv = slider1 + hozdiv + vertdiv2;

				// menu highlite shi!!
				
				menuName = '#vertmenu_1_' + contentid;
				$('.vertmenu_up').removeClass('vertmenu_up').addClass('vertmenu_1');
				$(menuName).removeClass('vertmenu_1').addClass('vertmenu_up');
				
				switch (position) {
					case 'down':
						newposition = 'up';
						break;
						
					case 'up':
						newposition = 'down';
						break;
						
					case 'left':
							newposition = 'right';
							break;
							
					case 'right':
						newposition = 'left';
						break;
		
				}
			
				$(currentdiv).stop(true, true).hide("slide", {
					direction: newposition
				}, 1000);
				
				$('#loading').css( {display: 'block'});
			
				$.ajax({
					type: "get",
					url: "/cfc/remote.cfc",
					data: {
						method: "fncPage",
						returnFormat: 'json',
						contentid: contentid,
						main_site: siteid,
						innertype: 2
					
					},
					
					dataType: "json",
					
					
					success: function(r){
						
						
						$(currentdiv).html(' ');
						$(newdiv).html( r.HELLO);	
						
						jQuery(document).ready(function () {
							$(this).attr('title',r.METATITLE);
						});	
						
	
						$(newdiv).stop(true, true).show("slide", {
							direction: position
						}, 1400, function(){	
						
							setTimeout('colresize()',1000);
								
							newHeight1 = $(newdiv + ' > #col1 ').height();
						
						
								newHeight2 = $(newdiv + ' > #col2 ').height();
							
								if (newHeight2 > newHeight1)
								{
									newHeight1=newHeight2;
								}
							
							
						
							if(newHeight1 <= 400){
								newHeight1 = 400;	
							}
									
							else{
								newHeight1 =  newHeight1 + 40;								
							}
							
							$('.slidediv').height(newHeight1);
							$('.horizontal_holder').height(newHeight1);
							$(newdiv).height(newHeight1);
							footercontent(newHeight1);
							
							
							$('#loading').css( {display: 'none'});
							printbutton(contentid,r.SEOURL);
							c = "/"+r.SEOURL+"-"+contentid+".html";
							
							
						    trackPageView(c);
							
							
						});					
					},
					
					error: function(r, strError){
					//alert(strError)
					}
					
				});
				
			}
		}
		
		
		
		function pagedetailcall(position, contentid, siteid, listpageid,original_type,pagination_num,catid,month1,year1,day1){
		
			if (fxque()){
			

				
				
				if (slidediv == 1) {	
					
					if (!$('#horizontal_holder1').length) {
						slidediv = 2
					}
					
					
					sdivC = '#slide1';
					sdivN = '#slide2';
					
					currentSdiv = '#slide1 > ';
					newSdiv = '#slide2 > ';
				}
			
				else {
					
					if (!$('#horizontal_holder1').length) {
						slidediv = 1;
					}
					
					
					
					sdivC = '#slide2';
					sdivN = '#slide1';
					
					currentSdiv = '#slide2 > ';
					newSdiv = '#slide1 > ';
				}
				
				if ($('#horizontal_holder1').length) {
					if (horizontal_holder == 1) {
						
						horizontal_holder = 2;
						currentHdiv = '#horizontal_holder1';
						newHdiv = '#horizontal_holder2';
					}
					
					else {
					
						horizontal_holder = 1;
						currentHdiv = '#horizontal_holder2';
						newHdiv = '#horizontal_holder1';
					}
				}
				
				
				switch (position) {
					case 'down':
						newposition = 'up';
						break;
						
					case 'up':
						newposition = 'down';
						break;
						
					case 'left':
						newposition = 'right';
						break;
							
						case 'right':
						newposition = 'left';
						break;
				}
			
				
	
				if($('#horizontal_holder1').length || $('#horizontal_holder2').length){

					currentdiv = currentSdiv + currentHdiv;
					newdiv = currentSdiv + newHdiv;
					newDivforHeight = currentSdiv + newHdiv;
					setdiv = 0;	
				}
				
				else{
					newposition = 'up';
					currentdiv = sdivC ;
					newdiv = sdivN;
					newDivforHeight = sdivN + ' > #horizontal_holder1';
					setdiv = 1;	
				}
	
				slide_menu();
			
				$(currentdiv).stop(true, true).hide("slide", {
					direction: newposition
				}, 1000)
				
				
				$('#loading').css( {display: 'block'});
				
								
				$.ajax({
					type: "get",
					url: "/cfc/remote.cfc",
					data: {
						method: "fncPageDetail",
						returnFormat: 'json',
						contentid:contentid, main_site:siteid, listpageid:listpageid, setdiv:setdiv,original_type:original_type,pagination_num:pagination_num,catid:catid,month1:month1,year1:year1,day1:day1
					
					},
					
					dataType: "json",
					
					
					success: function(r){
												
						$(currentdiv).html(' ');
						$(newdiv).html(r.HELLODETAIL);
						
						jQuery(document).ready(function () {
							$(this).attr('title',r.METATITLE);
						});	
									
						
						$(newdiv).stop(true, true).show("slide", {
						 direction: position
						 }, 1400, function(){	
							colresize()
							
							
							newHeight1 = $(newDivforHeight + ' > .verticle_holder > #col1 ').height();
							//alert(newHeight1)
						
							if(newHeight1 <= 380){
								newHeight1 = 400	
							}
							else{
								
								if(newHeight1 <= 380){
									newHeight1 = 400;	
								}
									
								else{
									newHeight1 = newHeight1 + 80;								
								}
								
							}
							
						
							$(newDivforHeight).height(newHeight1);
							
							$('.slidediv').height(newHeight1);	
							footercontent(newHeight1);
							$('#loading').css( {display: 'none'});		
							printbutton(contentid,r.SEOURL);
							
						
							
							if (r.ISNEWS == 0)
							{
							 c = "/"+r.SEOURL+"-"+contentid+".html";
							 globalhash =  contentid;
							 location.hash = contentid;
							 
							 
							 trackPageView(c);
							 
							}
							else
							{
							/*
							 IF SEARCH RESULT LOAD SEARCH RESULT
							*/
							 if (original_type == 3)
							 {
							 	c = "/"+r.LISTINGPAGESEOURL+"-1628/"+r.SEOURL+"-"+contentid+".html";
							 	globalhash = "1628I" + contentid
							 	location.hash = "1628I" + contentid;
							 
							 }
							 else
							 {
							 	
							 	c = "/"+r.LISTINGPAGESEOURL+"-"+listpageid+"/"+r.SEOURL+"-"+contentid+".html";
							 	
							 	globalhash = listpageid + "I" + contentid;
							 	location.hash = listpageid + "I" + contentid;
							
								trackPageView(c);
							 
							 }
							
							
							
							}
							
							
						});			
					},
					
					error: function(r, strError){
					//alert(strError)
					}
					
				});
				
			}
			
		}
		
		var pageid = 1;
		
		function setSearchPage(thePage)
		{
		 pageid = thePage;
		
		}
				
		function searchresults(position, main_site, contentid) {
			
		
			if (fxque()){
				globalhash  = contentid;
				location.hash = contentid;
				box = $('#frmSearchBox').val();
				site = $('#frmSearchSite').val();
				area = $('#frmSearchArea').val();
				d1 = $('#frmDate1').val();
				d2= $('#frmDate2').val();
			
	
				if (slidediv == 1) {	
					
					if (!$('#horizontal_holder1').length) {
						slidediv = 2
					}
						
					sdivC = '#slide1';
					sdivN = '#slide2';
					
					currentSdiv = '#slide1 > ';
					newSdiv = '#slide2 > ';
				}
			
				else {
					
					if (!$('#horizontal_holder1').length ) {
						slidediv = 1;
					}
					
					sdivC = '#slide2';
					sdivN = '#slide1';
					
					currentSdiv = '#slide2 > ';
					newSdiv = '#slide1 > ';
					
				}
				
				if ($('#horizontal_holder1').length) {
					
					if (horizontal_holder == 1) {
						
						horizontal_holder = 2;
						currentHdiv = '#horizontal_holder1';
						newHdiv = '#horizontal_holder2';
					}
					
					else {
					
						horizontal_holder = 1;
						currentHdiv = '#horizontal_holder2';
						newHdiv = '#horizontal_holder1';
					}
				}
		
	
				switch (position) {
					case 'down':
						newposition = 'up';
						break;
						
					case 'up':
						newposition = 'down';
						break;
						
					case 'left':
						newposition = 'right';
						break;
						
					case 'right':
						newposition = 'left';
						break;
				}		
				
			
				
				if($('#horizontal_holder1').length || $('#horizontal_holder2').length){

					currentdiv = currentSdiv + currentHdiv;
					newdiv = currentSdiv + newHdiv;
					newDivforHeight = currentSdiv + newHdiv;
					setdiv = 0;	
				}
				
				else{
					newposition = 'up';
					currentdiv = sdivC ;
					newdiv = sdivN;
					newDivforHeight = sdivN + ' > #horizontal_holder1';
					setdiv = 1;	
				}
				
			
				
				$(currentdiv).stop(true, true).hide("slide", {
					direction: newposition
				}, 1500);
				
				$('#loading').css( {display: 'block'});

				slide_menu();
								
				$.ajax({
					type: "get",
					url: "/cfc/remote.cfc",
					data: {
						method: "fncSearchResults",
						returnFormat: 'json',
						contentid: contentid, box:box, site:site, area:area, d1:d1, d2:d2 ,main_site:main_site,setdiv:setdiv,pageid:pageid  
					},
					
					dataType: "json",
					
					
					success: function(r){
											
						$(currentdiv).html(' ');
						$(newdiv).html(r.HELLODETAIL);
						
						$(newdiv).stop(true, true).show("slide", {
						 direction: position
						 }, 1400, function(){	
						 
							 	
						
							newHeight1 = $(newDivforHeight + ' > #col1 ').height();
	
							if(newHeight1 <= 400){
								newHeight1 = 400	
							}
							else{
							
								if(newHeight1 <= 400){
									newHeight1 = 400;	
								}
										
								else{
									newHeight1 = newHeight1 + 40;								
								}
								
							}
							
							
							$('.slidediv').height(newHeight1);	
							$(newDivforHeight).height(newHeight1);	
							colresize();
							footercontent(newHeight1);
							$('#loading').css( {display: 'none'});	
						
						});			
					},
					
					error: function(r, strError){
					//alert(strError)
					}
					
				});
				
			}
		}
	
		
		
		
			
		function slide_menu(){
			
			
	
			topslideUp();
	
			$("#slidemenu1").stop(true, true).animate({
				marginTop: '140px'
			}, 'slow');
		
			
			$(".slidediv").stop(true, true).animate({
				marginTop: '90px'
			}, 'slow');
			
		
		}

		
	function init_slide(position,load1,gallerycatid,toplevel){
			
			
		newposition = 'right';
		newSlide = toplevel;
				
		currentslidename = '#slide_index_media'+ gallery_slide;
		newslidename = '#slide_index_media'+ newSlide;
		
		
		$(currentslidename).stop(true, true).hide("slide", {
					direction: 'left'
		}, 1000);
		
		$(newslidename).stop(true, true).show("slide", {
					direction: 'right'
		}, 1000);
		
		gallery_slide = toplevel;

	}
		
		
	function top_slide(position,load1,gallerycatid,siteid)
	{
		
		if (siteid == 1)
		{
			max_results = 5;
		}
		else
		{
			max_results = 3;
		}
		
		if (fxque()){
			s1  = '#slide_index_media1';
			s2  = '#slide_index_media2';
			s3  = '#slide_index_media3';
			
			// if position = left gallery_slide -1 | if gallery_slide == 1  gallery_slide = 3
			// if position = left gallery_slide +1 | if gallery_slide == 3  gallery_slide = 1
			
			originalSlide = gallery_slide;
			
			if(position == 'left'){
				gallery_slide = gallery_slide - 1;
				if(gallery_slide < 1){
					gallery_slide = max_results;
				}
			}
			
			else if(position == 'right'){
				gallery_slide = gallery_slide + 1;
				if(gallery_slide > max_results){
					gallery_slide = 1;
				}
			}
			
			oldSlide = '#slide_index_media' + originalSlide;
			newSlide = '#slide_index_media' + gallery_slide;
			
			switch(position){
   			
   			case 'left':
   				newposition = 'right';
   			break;
   			
   			case 'right':
   				newposition = 'left';
   			break;	
   			}
			
			
			if(newSlide == '#slide_index_media1'){
				newindex_gallery(gallerycatid,oldSlide,newSlide,position,newposition,siteid)	
			}
			
			else{
			
				$(oldSlide).stop().hide("slide", { direction: position }, 1000);
				$(newSlide).stop().show("slide", { direction: newposition }, 1000 ).css({opacity:.99});
			
			}
		}			
	}
		
		
		function newindex_gallery(gallerycatid,oldSlide,newSlide,position,newposition,siteid){
			
			if (fxque()){
						   		   				
	   				$('#loading').css( {display: 'block'});
					
					$.ajax(
					 {
						 type: "get",
						 url: "/cfc/remote.cfc",
						 data: {
						 method: "fncNewIndexSlideShow",returnFormat: 'json',gallerycatid:gallerycatid,playername:'newplayer',site_id:siteid
						 
					 },
					
					 dataType: "json",
					 success: function( r ){ 
						$(newSlide+"_video").html( r.THUMBNAIL );
					 	
   						$(oldSlide).stop().hide("slide", { direction: position }, 1000);	
   						$(newSlide).stop().show("slide", { direction: newposition }, 1000).css({opacity:.99});				 		
						
						
		
						$('#loading').css( {display: 'none'});
					 	  //showSplash(r.PICTURETHUMBNAIL,r.PLAYERNAME);
						
					 },
					 
					 error: function( r, strError ){
					 	//alert(strError)
					 }
				 
		   		});
		   	}	
		
		}
		
		
		
		function index_gallery(position,load1,gallerycatid)	{
	   	
			
	   		if (fxque()){

			   		if (gallery_slide == 1){
			   			gallery_slide = 2;
			   			currentdiv = '#slide_index_media2';
			   			newdiv =  '#slide_index_media1';
			   			newplayer = 'newplayer';
			   			oldplayer = 'currentplayer';
			   		}
			   		
			   		else{
			   			gallery_slide = 1;
			   			currentdiv = '#slide_index_media1';
			   			newdiv =  '#slide_index_media2';
			   			newplayer = 'currentplayer';
			   			oldplayer = 'newplayer';
			   		}
			   		
			   		switch(position){
			   			case 'left':
			   			newposition = 'right';
			   			break;
			   			
			   			case 'right':
			   			newposition = 'left';
			   			break;	   			
			   		}
	   				
	   				$('#loading').css( {display: 'block'});
					
					$.ajax(
					 {
						 type: "get",
						 url: "/cfc/remote.cfc",
						 data: {
						 method: "fncIndexSlideShow",returnFormat: 'json', listPos: actualListPos, position:position, gallerycatid:gallerycatid,playername:newplayer
						 
					 },
					
					 dataType: "json",
					 success: function( r ){ 

					 	if(load1){
					 		
					 		$(currentdiv).html(oldfilm);
		   					$(currentdiv).stop().hide("slide", { direction: newposition }, 1000);
					 	
					 		actualListPos = r.LISTPOS;				 		
							$(newdiv).stop().show("slide", { direction: position }, 1000 ).html( r.FILM ).css({opacity:.99});
							oldfilm = r.THUMBNAIL ;
						}
						else{
							actualListPos = r.LISTPOS;
							$(newdiv).html(r.FILM);
							 oldfilm =  r.THUMBNAIL ;
						}
						
						$('#loading').css( {display: 'none'});
					 	showSplash(r.PICTURETHUMBNAIL,r.PLAYERNAME);
						
					 },
					 
					 error: function( r, strError ){
					 	//alert(strError)
					 }
				 
		   		});
		   	}	
		}
		
		function showSplash(file,p){
			newp = '#'+p;
			imageUrl = "media/videos/splash/"+file;
			$(newp).css('background-image', 'url(' + imageUrl + ')');
		}
	
	
		
		function showPlayer(file,p)
		{
	
			  
				$f(p, "flash/flowplayer-3.2.7.swf", {
				  		    
				    clip: {
				        url: "media/videos/"+ file,
				        autoPlay: true,
				        autoBuffering: true
				    },
				  
				    plugins: {
				        viral: 
				        {
							// load the viral videos plugin
							url: '/flash/flowplayer.viralvideos-3.2.5.swf'
						}
				        
				    } ,
				   
				    wmode: "transparent"				    
				}).ipad();			
						 
		
				$f(p, "flash/flowplayer-3.2.7.swf", {
				  		    
				    clip: {
				        url: "media/videos/"+ file,
				        autoPlay: true,
				        autoBuffering: true
				    },
				  
				   plugins: {
				        viral: 
				        {
							// load the viral videos plugin
							url: '/flash/flowplayer.viralvideos-3.2.5.swf'
						}
				        
				    } ,
				   
				    wmode: "transparent"				    
				}).ipad();		
		}
			
	
	function fxque(){
		
		var  rtn = true;
		
		if($('#top1').queue("fx").length){		
			rtn = false;
		}
		
		if($('#slidemenu1').queue("fx").length){		
			rtn = false;
		}
		
		if($('#slide_index_media1').length){
			if ($('#slide_index_media1').queue("fx").length) {
				rtn = false;	
			}	
		}
		
		if($('#slide_index_media2').length){
			if ($('#slide_index_media2').queue("fx").length) {
				rtn = false;	
			}	
		}
		
		if($('#slide_index_media3').length){
			if ($('#slide_index_media3').queue("fx").length) {
				rtn = false;	
			}	
		}
		
		if($('#slide_index_media4').length){
			if ($('#slide_index_media4').queue("fx").length) {
				rtn = false;	
			}	
		}
		
		if($('#slide1').queue("fx").length || $('#slide2').queue("fx").length){	
				rtn = false;	
		}
		
		if($('#horizontal_holder1').length){
			if ($('#horizontal_holder1').queue("fx").length) {
				rtn = false;
				
			}	
		}
		
		if($('#horizontal_holder2').length){
			if ($('#horizontal_holder2').queue("fx").length) {
				rtn = false;
				
			}	
		}
		
		if($('#vertical_holder1').length){
			if ($('#vertical_holder1').queue("fx").length) {
				rtn = false;
				
			}	
		}
		
		
		if($('#vertical_holder2').length){
			if ($('#vertical_holder2').queue("fx").length) {
				rtn = false;	
			}	
		}
		
		if($('#slide_index_media1').length){
			if ($('#slide_index_media1').queue("fx").length) {
				rtn = false;	
			}	
		}
		
		if($('#slide_index_media2').length){
			if ($('#slide_index_media2').queue("fx").length) {
				rtn = false;	
			}	
		}
		
			
		return rtn;
		
	}
	
	function breadcrumb(cid,max_depth,main_site){
		
		$.ajax(
		 {
		 
			 type: "get",
			 url: "/cfc/remote.cfc",
			 data: {
			 method: "fncBreadcrumb",returnFormat: 'json', contentID:cid,max_depth:max_depth,main_site:main_site
			 
		 },
					
		 dataType: "json",
		 success: function( r ){ 
			
			$('.breadcrumb').html(r.DAILYBREAD)
			
		 },
		 
		 error: function( r, strError ){
		 	//alert(strError)
		 }
	 
		});
		
	}
	
	function breadcrumbchris(newsid){
		
		$.ajax(
		 {
			 type: "get",
			 url: "/cfc/remote.cfc",
			 data: {
			 method: "fncBreadcrumbchris",returnFormat: 'json', newsID:newsid
			 
		 },
					
		 dataType: "json",
		 success: function( r ){ 
			
			//alert(r.DAILYBREAD)
			//$('.breadcrumb').html(r.DAILYBREAD)
			
		 },
		 
		 error: function( r, strError ){
		 	//alert(strError)
		 }
	 
		});	
		
		
		
	}
	
	function breadcrumbnews(pid,p_max_depth,news_id,main_site){
		$.ajax(
		 {
			 type: "get",
			 url: "/cfc/remote.cfc",
			 data: {
			 method: "fncBreadcrumb",returnFormat: 'json', contentID:pid,max_depth:p_max_depth,news_id:news_id,main_site:main_site
			 
		 },
					
		 dataType: "json",
		 success: function( r ){ 
			
			$('.breadcrumb').html(r.DAILYBREAD)
			
		 },
		 
		 error: function( r, strError ){
		 	//alert(strError)
		 }
	 
		});
		
	}
	
function colresize(){

	if (horizontal_holder == 1) {
		newHdiv = '#horizontal_holder1';
	}
	
	else {
		newHdiv = '#horizontal_holder2';
	}
	
	if (vertical_holder == 1) {
		newVdiv = '#verticle_holder1';
	}
	
	else {
		newVdiv = '#verticle_holder2';
	}
	
	
	
	if ($(newHdiv + ' > ' + newVdiv).length){
	
		if(!$(newHdiv + ' > ' + newVdiv + ' > #col2').length){
		
			if ($(newHdiv + ' > .verticle_holder_with_menu').length){
				$(newHdiv + ' > ' + newVdiv + ' > #col1').css({width: '725px'});
			}
			else{
			
				$(newHdiv + ' > .verticle_holder > #col1').css({width: '880px'});
			}
		}
	}
	

}

function reloadresize(){
							
	newDivHeight =  ' .slidediv > #horizontal_holder1 > #verticle_holder1 > #col1';
	newHeight1 = $(newDivHeight).height();			
	
	
	if(newHeight1 <= 400){
		newHeight1 = 400;	
	}
	else{
		newHeight1 = newHeight1   + 40;	
	}
	

	$('.slidediv').height(newHeight1);
	$('#horizontal_holder1').height(newHeight1);
	$('#horizontal_holder1 > #verticle_holder1').height(newHeight1);
	footercontent(newHeight1);		
}

function loadMenu(parent_id,main_site,localID)
{
		$.ajax(
		 {
			 type: "get",
			 url: "/cfc/remote.cfc",
			 data: {
			 method: "fncReloadTopMenu",returnFormat: 'json', parent_id:parent_id,main_site:main_site,localID:localID
			 
		 },
					
		 dataType: "json",
		 success: function( r ){ 
			
			$('#slidemenu1').html(r.HTML);
			
		 },
		 
		 error: function( r, strError ){
		 	//alert(strError)
		 }
	 
		});
		
}

function footercontent(newHeight1){
	
	lMarginTop = newHeight1 + 290;					
	$('.footer_content').css({ marginTop: lMarginTop});	
}

function printbutton(contentid,seourl){

		


		var thestring = '<a onclick="';
		thestring = thestring + "showprintdialog('/"+seourl+"-"+contentid+"-print.html');"; 
		thestring = thestring + '">';
		thestring = thestring + '<img  border="0" src="/images/print.png">';
		thestring = thestring + '</a>';
		
		document.getElementById("printbut").innerHTML = thestring;

		 window.addthis = null;
		 
		 var b = '<a class="addthis_button_expanded"';
		 b = b + 'addthis:url="http://'+window.location.hostname+'/'+seourl+'-'+contentid+'.html"';
		 b = b + 'href="http://www.addthis.com/bookmark.php">';
		 b = b + '<img src="/images/share.png" alt="share icon" title="AddThis" />';
		 b = b + '</a>';
		 
		 document.getElementById("theAddThis").innerHTML = b;

		 var script = document.createElement("script");
  
		  script.type = "text/javascript";
		  script.src = "http://s7.addthis.com/js/250/addthis_widget.js#domready=1";
		  document.body.appendChild(script);



		 setTimeout("window.addthis.init()",1000);


}

function isHashk_19(hash1,method){

/*
	globalhash = 0;
	globalhashid = 0;
*/

	$.ajax(
		 {
			 type: "get",
			 url: "/cfc/remote.cfc",
			 data: {
			 method: "fncHashk_19",returnFormat: 'json', hash1:hash1
			 
		 },
					
		 dataType: "json",
		 success: method,
		 error: function( r, strError ){
		 	//alert(strError)
		 }
	 
		});
		
		/*
		return {
				"globalhash":globalhash,
				"globalhashid":globalhashid
				};
	*/	
}



