function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}
var box='';
var descTitle;
$(document).ready(function(){ 
 	$.sifr({ path: "sifr/fonts/"});
  	$('#time').jclock();
 	var options = {};
	var current ='';
 	jQuery('ul.sf-menu').superfish();
 	$('#img_rolover').innerfade({
		speed: 3000,
		timeout: 10000,
		type: 'sequence'
	}); 
	$(".img_rolover1").each(function (i) {
		 var id = $(this).attr('id'); 
 		 $(this).html('<img src="imgs/sites/'+id+'.jpg">');
	});
	$(window).load(function () {
			$('.clock').sifr({path: 'sifr/fonts/', font: 'Futura', color:'#fff'});
    });
 	$('#send_contact').submit(function(){
 		return false;
	});
   	$('.link-menu-top').click(function(){
			current2='';
			box='';
			$("#main_content2").hide();
			var url = $(this).attr('href');
			var getVar = url.split('?');
 			$('#main_content_title').html('');
 			$('#pane1').html('');
			$('#img_rolover').hide();
			$('.img_rolover1').hide();
			var idDiv = getVar[1].split('&');
			var idImg = idDiv[0].split('=');
			$('#' + idImg[1]).fadeIn(3000);
			if(current.length == 0){
					current=1;
			}else{
				$("#main_content").hide('slide',options,500);
			}
 			$('#pane1').load('content_desc.php?'+getVar[1],[],function(data){
																		descTitle = data.split('||'); $('#pane1').html('');
 																		if(idImg[1]!=111 && idImg[1]!=52){
																		 $('#paramswf').attr('value','./imgs/type.swf?'+getVar[1]);
																		 $('#embedswf').attr('src','./imgs/type.swf?'+getVar[1]);																								
																		 $("#main_content").show('slide',options,1000,function(){$('#pane1').html($('#flash_content').html());$('#main_content_title').html(descTitle[0]);$(".backTitle").sifr({ font: "Futura" }); });
																		}else{
																		 $("#main_content").show('slide',options,1000,function(){$('#pane1').html(descTitle[1]);$('#main_content_title').html(descTitle[0]);$(".backTitle").sifr({ font: "Futura" });});
																		}$('#pane1').jScrollPane();
																	});
   		return false;
	});  
});
function showResponse(html){
}
function submitContact(obj){
 		$.ajax({
			type: 'POST',
			url: $(obj).attr('action'),
			data: $(obj).serialize(),
			success: function(html){alert(html); obj.reset();}
 		});
 		return false;
}
var current2='';

function clicksubmenucontent(obj){
 			var options = {direction: "right"};
			box=2;
			var url = $(obj).attr('href');
			var getVar = url.split('?');
 			$('#main_content_title2').html('');
 			$('#pane12').html('')			
			if(current2.length == 0){
					current2=1;
			}else{
				$("#main_content2").hide('slide',{direction: "right"},1500);
			}
  			$('#pane12').load('content_desc.php?'+getVar[1],[],function(data){
																		descTitle = data.split('||'); $('#pane12').html('');
 																		 $('#paramswf2').attr('value','./imgs/type.swf?'+getVar[1]);
																		 $('#embedswf2').attr('src','./imgs/type.swf?'+getVar[1]);																								
																		 $("#main_content2").show('slide',options,1000,function(){$('#pane12').html($('#flash_content2').html());$('#main_content_title2').html(descTitle[0]);$(".backTitle").sifr({ font: "Futura" }); });
 																	});
   		return false;
}
function showimagegallery(){
	if(descTitle[2].length > 20){
		$('#pane1'+box).append(descTitle[2]);
	    $("#galleryaboutus li a").lightBox();
		$("#gallerycliff li a").lightBox();
	}
}
