
// Load jQuery
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");





google.setOnLoadCallback(function(){
	$.getScript("http://js.webpromotioninsights.com/2009/04/22/curvycorners.js");
	//$.getScript("js/easing.js");

//$(document).ready(function(){
	/*PRINT*/
	$('#save-as .print a').click(function(){print();return false;});
	
	/*SEARCH*/
	var a1=document.getElementById('search').getElementsByTagName('label')[0].innerHTML;
	var a2=document.getElementById('search-inpt');
	if((a2.value=='')||(a2.value==a1)){a2.className='default'; a2.value=a1;}
	a2.onfocus = function(){if(this.value==a1){this.className=''; this.value='';}};
	a2.onblur = function(){if(this.value==''){this.className='default'; this.value=a1;}};
	
	/*CONTENT INDEX*/
	if(document.getElementById('website-maintenance')!=undefined){
		var b1=document.getElementById('website-maintenance').getElementsByTagName('ul');
		var b2=b1[0].getElementsByTagName('li'); //tabs
		var b3=b1[1].getElementsByTagName('li'); //content
		var b4=b1[2].getElementsByTagName('li'); //controls
		b2[0].onclick= function(){b2[0].className="first active";b3[0].className="show";b2[1].className="last";b3[1].className="hide";b4[0].className="more";b4[1].className="more hide";return false;};
		b2[1].onclick= function(){b2[0].className="first";b3[0].className="hide";b2[1].className="last active";b3[1].className="show";b4[0].className="more hide";b4[1].className="more";return false;};
	}
	
	
	/* CHATS */
	if($('#gtalk-sales').length>0){
		$("#gtalk-sales").click(function(){
			window.open("http://www.google.com/talk/service/badge/Start?tk\x3dz01q6amlq16rdfqqeree9or85ffblelt63cun0jplr1geovppb28n13ncnahvvg7iuro60sdnpe2ai2dj22sd26bd60ime8umb4k6f9no3tkmpsshvp37th5gmtkq2sve0f8augp429bcu4ma46k3imot62b8inrnc207al81l60jm3858d5v243g8cc6l7sh4g","","status=0,scrollbars=0,menubar=0,statusbar=0,resizable=1, width=300,height=500,location="+(window.ActiveXObject&&window.XMLHttpRequest?"0":"1"));
			return false;
		});
		
		$("#gtalk-info").click(function(){
			window.open("http://www.google.com/talk/service/badge/Start?tk\x3dz01q6amlq19s6i0b1b9ucvu47pj0h49rpn8fo1ag7bs49kq0mrq2d15mq31gpaan024lbcv9simovn99q5lk9s7f1ki1er1igfcggskqg19j2sqkh6hmbbhtik1qhclnor9d5gq7ohit3cvmv2erh6je3qte58k43n7498qet7th9dt7aupvkn36a902pqtu58s","","status=0,scrollbars=0,menubar=0,statusbar=0,resizable=1, width=300,height=500,location="+(window.ActiveXObject&&window.XMLHttpRequest?"0":"1"));
			return false;
		});
	}
	
	$.getScript("http://js.webpromotioninsights.com/2009/04/22/cycle.js", function(){
		/*PORTFOLIO*/
		$('#portfolio .content').cycle({ 
			fx:    'fade', 
			pause:  1,
			speed: 700,
			timeout: 8000,
			cleartype:1,
			cleartypeNoBg:1,
			next:   '#portfolio .controls .next', 
			prev:   '#portfolio .controls .prev'
		});
		
		/*BLOG*/
		$('#blog .post').cycle({ 
			fx:    'fade', 
			pause:  1,
			speed: 700,
			timeout: 8000,
			cleartype:1,
			cleartypeNoBg:1,
			next:   '#blog .controls .next', 
			prev:   '#blog .controls .prev'
		});
		$('#blog .comments').cycle({ 
			fx:    'fade', 
			pause:  1,
			speed: 700,
			timeout: 8000,
			cleartype:1,
			cleartypeNoBg:1,
			next:   '#blog .controls .next', 
			prev:   '#blog .controls .prev'
		});
	});
	
	jQuery.fn.openpopup = function(){
    var popup = arguments[0] || {};
		
		$("body").append('<div id="overlay"></div>');
		$('#overlay').css({'filter':'alpha(opacity=40)', '-moz-opacity':'0.4', 'opacity':'0.4'});
		
		$("body").append('<div id="popup-'+popup.ID+'" class="popup"><div class="container"><div class="content"></div></div><div class="close"></div></div>');
		$("#popup-"+popup.ID+" .content").html(popup.content);
		
		windowCSS = {
			width:popup.width+popup.border.width*2+"px",
			height:popup.height+popup.border.width*2+popup.radius*4+"px",
			position:'absolute',
			top:'50%',
			left:'50%',
			marginTop:(-1)*(popup.height+popup.border.width*2+popup.radius*4)/2+"px",
			marginLeft:(-1)*(popup.width+popup.border.width*2+popup.radius)/2+"px",
			'filter':'alpha(opacity='+popup.opacity+')',
			'-moz-opacity':popup.opacity/100,
			'opacity':popup.opacity/100
		}
		$('#popup-'+popup.ID).css(windowCSS);
		
		containerCSS = {
			width:popup.width+"px",
			height:popup.height+"px",
			border:popup.border.width+"px "+popup.border.style+" "+popup.border.color,
			background:popup.background
		}
		$('#popup-'+popup.ID+' .container').css(containerCSS);
		
		$('#popup-'+popup.ID+' .container').corner({tl:{radius:popup.radius},tr:{radius:popup.radius},bl:{radius:popup.radius},br:{radius:popup.radius},antiAlias:true,autoPad:true,validTags:["div"]});
		$('#popup-'+popup.ID).draggable();
		
		$("#overlay").fadeIn("normal", function(){$('#popup-'+popup.ID).appearpopup();});
		$('#popup-'+popup.ID+' .close').click(function(){$('#popup-'+popup.ID).closepopup();});
		$("#overlay").click(function(){$('#popup-'+popup.ID).closepopup();});
		
  };
  
  jQuery.fn.appearpopup = function(){
		$(this).fadeIn("normal");
	};
	
	jQuery.fn.disappearpopup = function(){
		$(this).fadeOut("normal", function(){$(this).remove();});
	};
  
  jQuery.fn.closepopup = function(){
		$("#overlay").fadeOut("normal", function(){$("#overlay").remove();});
		$(this).disappearpopup();
	};



 $("#presentation-popup").click(function(){
	$(this).openpopup({
		ID:'presentation',
		width:647,
		height:543,
		border:{width:1,style:'solid',color:"#666"},
		content:'<div class="title">'+$(this).attr("title")+'</div><div style="width:600px; height:500px; margin:0 auto; text-align:left" id="__ss_1612653"><object style="margin:0px" width="600" height="500"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=insightpresentationforarmeniantourismsector-090620085006-phpapp01&rel=0&stripped_title=insight-presentation-for-armenian-tourism-sector" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=insightpresentationforarmeniantourismsector-090620085006-phpapp01&rel=0&stripped_title=insight-presentation-for-armenian-tourism-sector" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="500"></embed></object></div>',
		radius:10,
		background:"#fff",
		opacity:100
	});
	return false;
 });
 /*
 472x420
 425x354
 600x500
 647x563
 */
});
