function jlink(div,file) {
	jQuery.ajax({ type: "GET", cache : false, url: file, success: function(msg){	$('#'+div).html(msg); } });
}

function jform(div,file,jmethod,parameter){
	jQuery.ajax({ type: jmethod, cache : false, url: file,data: parameter, success: function(msg){	$('#'+div).html(msg); } });
}

function vIE(){return (navigator.appName=='Microsoft Internet Explorer')?parseFloat((new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")).exec(navigator.userAgent)[1]):-1;}

function getPageScroll() {
	var xScroll, yScroll;
	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}
	return new Array(xScroll,yScroll)
}

function getPageHeight() {
	var windowHeight
	if (self.innerHeight) {	// all except Explorer
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowHeight = document.body.clientHeight;
	}
	return windowHeight
}


function popurl( url ) {
	popbox(url,"");
}


close_error = function() {
	jQuery('#error').animate({opacity: 0, height: "0px", display : "none" }, 1000 );

}

function flash_popup(url, title, width, height) {
	window.open(url,title,'menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,width='+width+',height='+height);
}

var agt=navigator.userAgent.toLowerCase();
var ie  = (agt.indexOf("msie") != -1);
var ns  = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);

if (ie && win) {	pluginlist = detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash"); }
if (ns || !win) {
	nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = detectNS("application/x-shockwave-flash","Shockwave Flash");
}

function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }

pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);


function kayitform() {

	if(vIE()<7 && navigator.appName=='Microsoft Internet Explorer') {
		
		window.location = '/index.php';
		window.open('/index.php','_self');
		
		
	} else {
	
	var html = '<div id="popbox_overlay" onclick="kayitformkapa();"></div>';

	$('body').append(html);
	try {
		$("#freeReg").draggable();
	} catch(e) {
	}

	pos = "fixed";

	var x_top = (getPageHeight()/2) - ($("#freeReg").height()/2);
	var x_left = (($(document).width()/2)-($("#freeReg").width()/2));

	$("#freeReg").css({ 'z-index' :'99999', position : pos , 'left':x_left+"px",'top':x_top+"px" });

	$("#popbox_overlay").css({ 'z-index' :'99998','height':$(document).height()+"px", display:'block', 'opacity':'.60', 'filter' : 'alpha(opacity = 60)' });

	$("#freeReg").css('display','block');

	}
	
}

kayitformkapa = function() {
	$("#popbox_overlay").fadeOut(200);
	$("#freeReg").fadeOut(200);
	$("#popbox_overlay").remove();
}
