﻿var ispopshow = 0;
$(function(){
	$('a.lnkpopup').hover(function(){
	    $(this).css({cursor: 'hand', cursor: 'pointer'});
	},function(){});
	$('a.lnkpopup').click(function(){
		/*if($(this).attr('rel') != ''){
			msg = $(this).attr('title');
			showWindow(msg, null, 'Alert Website!');
		}else{*/
		    
			lnkpg = $(this).attr('rel');
			if(ispopshow) {
		        $('.dialogBody iframe').attr({src: lnkpg});
		        return false;
		    }
			ifrmpg = '<iframe src='+lnkpg+' style="background: white;" width="95%" height="95%"></iframe>';
			showWindow(ifrmpg, {hideCancelButton: false, title: 'Pop up website' }, 'Pop up website');
		//}
		return false;
	});
	
});

function showWindow(msg, options, title) {
    if (!options) options = {};
    options["title"] = title;
    if (!window["dialogWindows"]) window.dialogWindows = new Array();
	
    var dwindow = new DialogWindow(undefined, options);
	
	dwindow.el.style.width = '550px';
	dwindow.el.style.height = '410px';
	
    dwindow.show(msg);
    ispopshow = 1;
    
    window.dialogWindows.push(window);
    
}

function callPopUp(tt, href){
    if(ispopshow) {
        $('.dialogBody iframe').attr({src: href});
        return false;
    }
    
	ifrmpg = '<iframe src='+href+' style="background: white;" width="95%" height="95%"></iframe>';
	showWindow(ifrmpg, null, tt);
}
