var $j = jQuery.noConflict(); 

function poplogin()	{
	$j('#loginBox').css('display', 'block');		
}

function closelogin(){
	$j('#loginBox').css('display', 'none');	
}

$j(document).ready(function(){
	initCufon();
});

function initCufon() {
	/*
	Cufon.replace('#nav li a', { fontFamily: 'franklin_gothic_medium', hover: true });
	Cufon.replace('.visual-content h2', { textShadow: '#215209 2px 3px', fontFamily: 'avgr65w' });
	Cufon.replace('.faqpanel h2', { textShadow: '#B1BCAE 2px 3px', fontFamily: 'avgr65w' });
	Cufon.replace('.inform h2', { textShadow: '#1c5100 0 -1px', fontFamily: 'helvetica_bold'});
	*/
}

function showHelpModal(item) {
	$j('#helpModal').empty();
    if(item==1){
    	$j('<iframe src ="/help/research" id="helpFrame" width="860" height="400" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#helpModal');
    }else if(item==2){
    	$j('<iframe src ="/help/insights" id="helpFrame" width="860" height="400" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#helpModal');
    }else if(item==3){
    	$j('<iframe src ="/help/websites" id="helpFrame" width="860" height="400" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#helpModal');
    }else if(item==4){
    	$j('<iframe src ="/help/traffic" id="helpFrame" width="860" height="400" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#helpModal');
    }	
	$j("#helpModal").dialog({
		'modal':true, 
	    'width':875, 
	    'minWidth':875, 'minHeight':420, 
	    'draggable':false,
	    'resizable':false,
	    'zIndex':25000,
	    'title': APP_TITLE+" Help"
    }).dialog("open");		
}

function showPromoModal(item,title) {
	if (typeof title == "undefined") {
	    title=APP_TITLE;
	}
	$j('#promoModal').empty();
    if(item==1){
    	$j('<iframe src ="'+PUBLIC_BASE_URL+'/help/quicktour" id="promoFrame" width="660" height="500" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#promoModal');
    }else if(item==2){
    	$j('<iframe src ="'+PUBLIC_BASE_URL+'/help/sitebuilderdemo" id="promoFrame" width="660" height="500" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#promoModal');
    }else if(item==3){
    	$j('<iframe src ="'+PUBLIC_BASE_URL+'/help/challange" id="promoFrame" width="660" height="500" frameborder="0" scrolling="no"><p>Your browser does not support iframes.</p></iframe>').appendTo('#promoModal');
    }	
	$j("#promoModal").dialog({
		'modal':true, 
	    'width':680, 'height':550, 
	    'minWidth':680, 'minHeight':550, 
	    'draggable':false,
	    'resizable':false,
	    'zIndex':25000,
	    'title': title
    }).dialog("open");		
}

function showConfirmModal(msg, url, title, okText, cancelText) {
	if(okText==undefined){
		okText='Yes';
	}
	if(cancelText==undefined){
		cancelText='No';
	}
	var btns = {};
	btns[okText] = function(){
		$j("#confirmModal").dialog( "close" );
		document.location = url;
	};
	btns[cancelText] = function(){
		$j("#confirmModal").dialog( "close" );
		return false;
	};
	$j("#confirmModal").text(msg).dialog({
		'modal':true, 
	    'width':400, 'height':200, 
	    'minWidth':400, 'minHeight':200, 
	    'draggable':false,
	    'resizable':false,
	    'zIndex':25000,
	    'title': title,
	    'buttons': btns			
    }).dialog("open");		
}

