var ispopshow = 0;
$(function(){
	
	$('table.ppresult a.popreslt').click(function(){
	    lnkpg = $(this).attr('rel');
		if(ispopshow) {
	        $('.dialogBody iframe').attr({src: lnkpg});
	        return false;
	    }
		ifrmpg = '<iframe src='+lnkpg+' width="95%" height="95%" style="overflow: hidden;" scrolling="No"></iframe>';
		showWindow(ifrmpg, {hideCancelButton: false, title: 'Options College - Score Result' }, 'Options College - Score Result');
		
		return false;
	});
	
	$('.lnkpopup a').hover(function(){
	    $(this).css({cursor: 'hand', cursor: 'pointer'});
	},function(){});
	$('.lnkpopup div').click(function(){
		lnkpg = $(this).children('a').attr('rel');
		if(ispopshow) {
	        $('.dialogBody iframe').attr({src: lnkpg});
	        return false;
	    }
		ifrmpg = '<iframe src='+lnkpg+' width="95%" height="95%" style="overflow: hidden;" scrolling="No"></iframe>';
		showWindow(ifrmpg, {hideCancelButton: false, title: 'Options College - Login' }, 'Options College - Login');
		
		return false;
	});
	
	$('.blki div').click(function(){
		if($('.lnkpopup').children('.blk5').html() == null){
			lnkpg = $(this).children('a').attr('href');
			//alert(lnkpg);
			window.parent.location.href = lnkpg;
		}
		return false;
	});
	
	$('.lnkpopup a').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+' width="95%" height="95%" style="overflow: hidden;" scrolling="No"></iframe>';
			showWindow(ifrmpg, {hideCancelButton: false, title: 'Options College - Login' }, 'Options College - Login');
		//}
		return false;
	});
});

function showAlert(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 = '500px';
	dwindow.el.style.height = '90px';
	
    dwindow.show(msg);
    ispopshow = 1;
    window.dialogWindows.push(window);
}

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 = '350px';
	
    dwindow.show(msg);
    ispopshow = 1;
    window.dialogWindows.push(window);
}

function callPopUp(tt, href){
	ifrmpg = '<iframe src='+href+' width="95%" height="95%" style="overflow: hidden;"></iframe>';
	showWindow(ifrmpg, null, tt);
}