 $.post('/ajax/get_domains.php', {idbenefits: true}, function(data) {
	
	 if ( typeof data !== "undefined" && data ) {
		
		 for (var i=0;i<data.length;i++)
		 {			
		 	var siteUrl = data[i]['site_url'];
		 	
		 	if(window.location.href.indexOf(siteUrl) !== -1){		 		
		 		if ( $.browser.msie && parseInt($.browser.version) > 6 ) {
		 			try {
		 				if ( window.location.href.indexOf('ocenture.int') !== -1 ) {
		 					/** Sandbox mode **/
		 					sboxParts = window.location.href.split('.');		 					
		 					document.domain = sboxParts[2] + '.ocenture.int'; 
		 				}	else	{
		 					document.domain = siteUrl;
		 				}
		 			}	catch (err) {
		 				
		 			}
		 		}
		 	}
		 }
		 
	 }
},"json");


$('document').ready( function() {
	  $(document).pngFix(); 
	/** Get menu link **/
	var menuLink =  window.location.href;	
	
	if(menuLink.indexOf('redirect/') != -1){
		var menuItem = menuLink.split('redirect/');
		
		$('#' + menuItem[1]).colorFire();
	}	
	
	//layout.setArticlesHeight();	
	$('#closeErrorBox').click(function() {
		$('#error-box').hide('slow');
	});
	
	$('.resizeBox').click(function(){		
		var menuLink =  window.location.href;
		
		var elRel = $(this).attr('rel');
		elNvp = elRel.split('&');
		
		elWidths = elNvp[0].split('=');
		elwidth = elWidths[1];
		
		elHeights = elNvp[1].split('=');
		elheight = elHeights[1];
		
		elScrolls = elNvp[2].split('=');
		elScroll = elHeights[1];
		
		url = $(this).attr('href');
		
		parent.$.fn.colorbox({href: url, iframe: true, scrolling: elScroll, width: elwidth, height: elheight});
		
		
	});
});

var layout = new function(){
	
	this.setArticlesHeight = function(){
		if($('.article-content').length > 0){
			var artHeight = $('.article-content').height();			
			if(artHeight < 526) {
				$('.article-content').height(526);
			}
		}
	};

	this.resizeBox = function(width, height, url){	
		//alert(url);
		/*
		parent.$.fn.colorbox.settings['iframe'] = true;
		parent.$.fn.colorbox.settings['href'] = url;
		parent.$.fn.colorbox.settings['scrollable'] = true;
		parent.$.fn.colorbox.settings['open'] = true;
		parent.$.fn.colorbox.settings['width'] = parseInt(width);
		parent.$.fn.colorbox.settings['height'] = parseInt(height);		
		
		parent.$.fn.colorbox({href: 'http://google.ro', iframe: true, open:true}); */
		 
		
	}
};



