	function setCookie(name, value){
		var expire_date = new Date();
		expire_date.setDate(expire_date.getDate() + 100);
		expire_date.setHours(0,0,0,0);
		var cookieStr = name + "=" + escape(value) + ";ages = -1";
		cookieStr += "; expires=" + expire_date.toGMTString() +"; path=/; domain=" + document.location.hostname + ";";
		document.cookie = cookieStr;
	}
	function getCookieVal(offset){
		var endstr = document.cookie.indexOf(";", offset);
		if (endstr == -1)
		endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}
	//
	function getCookie(sName){
		var aCookie = document.cookie.split("; ");
		for (var i=0; i < aCookie.length; i++){
			var aCrumb = aCookie[i].split("=");
			if (sName == aCrumb[0]){
				return unescape(aCrumb[1]);
			}
		}
		return null;
	}
function FlashActivate ( strFlashUrl , n4Witdh , n4Height , strWmode , strId , strClassName , strFlashvar ) {
	//width,height
	if (n4Witdh != 0) {
		objSize_attribute = " width='"+ n4Witdh +"' height='"+ n4Height +"'";
	} else {
		objSize_attribute = "";
	}
	//id
	if (strId != 0) {
		objId_attribute = " id='" + strId + "'";
		objId_IE_attribute = " id='" + strId + "'";
	} else {
		objId_attribute = "";
		objId_IE_attribute = "";
	}
	//class
	if (strClassName != 0) {
		className_attribute = " class='" + strClassName + "'";
	} else {
		className_attribute = "";
	}
	//wmode
	if (strWmode != 0) {
		wmode_param = "<param name='wmode' value='" + strWmode + "' />";
		wmode_attribute = " wmode='" + strWmode + "'";
	} else {
		wmode_param = "";
		wmode_attribute = "";
	}
	//Flashvar
	if (strFlashvar != 0) {
		Flashvar_param = "<param name='flashvars' value='" + strFlashvar + "' />";
		Flashvar_attribute = " Flashvars='" + strFlashvar + "'";
	} else {
		Flashvar_param = "";
		Flashvar_attribute = "";
	}
	document.writeln( "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' " + objSize_attribute + objId_IE_attribute + className_attribute + ">" );
	document.writeln( "<param name='base' value='.' />" );
	document.writeln( "<param name='movie' value='"+ strFlashUrl +"' />" );
	document.writeln( "<param name='quality' value='high' />" );
	document.writeln( "<param name='menu' value='0' />" );
	document.writeln( "<param name='allowScriptAccess' value='always' />" );
	document.writeln( wmode_param );
	document.writeln( Flashvar_param );
	document.writeln( "<!-- Hixie method -->" );
	document.writeln( "<!--[if !IE]> <-->" );
	document.writeln( "<object type='application/x-shockwave-flash' allowScriptAccess='always' data='"+ strFlashUrl +"'" + Flashvar_attribute + objSize_attribute + objId_attribute + wmode_attribute + className_attribute + "></object>" );
	document.writeln( "<!--> <![endif]-->" );
	document.writeln( "</object>" );
}
function MovieActivate ( strMovieUrl , n4Width , n4Height , strId , n4AutoStart , n4ShowControls ) {
	//width,height
	if (n4Width != 0) {
		if (n4ShowControls == 0) {
			Realn4Height = n4Height;	
		} else {
			Realn4Height = n4Height + 45;
		}
		objSize_attribute = " width='"+ n4Width +"' height='"+ Realn4Height +"'";
	} else {
		objSize_attribute = "";
	}
	//Id
	if (strId != 0) {
		objId_attribute = " id='" + strId + "'";
		objId_IE_attribute = " id='" + strId + "IE'";
	} else {
		objId_attribute = "";
		objId_IE_attribute = "";
	}

	//ShowControls
	if (n4ShowControls == 0) {
		ShowControls_param = "<param name='showcontrols' value='false' />";
		ShowControls_attribute = " showcontrols='0'";
	} else if (n4ShowControls == 1){
		ShowControls_param = "<param name='showcontrols' value='true' />";
		ShowControls_attribute = " showcontrols='1'";
	}

	//AutoStart
	if (n4AutoStart == 0) {
		AutoStart_param = "<param name='autostart' value='false' />";
		AutoStart_attribute = " autostart='0'";
	} else if (n4AutoStart == 1){
		AutoStart_param = "<param name='autostart' value='true' />";
		AutoStart_attribute = " autostart='1'";
	}

	document.writeln( "<object id='objWMPlayer' name='objWMPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95'" + objId_IE_attribute + objSize_attribute +" codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'>");
	document.writeln( "	<param name='AudioStream' value='-1' />");
	document.writeln( "	<param name='AutoSize' value='false' />");
	document.writeln( "	<param name='AnimationAtStart' value='true' />");
	document.writeln( "	<param name='AllowChangeDisplaySize' value='true' />");
	document.writeln( "	<param name='BufferingTime' value='5' />");
	document.writeln( "	<param name='Enabled' value='true' />");
	document.writeln( "	<param name='EnableContextMenu' value='true' />");
	document.writeln( "	<param name='EnableTracker' value='true' />");
	document.writeln( "	<param name='PlayCount' value='1' />");
	document.writeln( "	<param name='Rate' value='1' />");

	document.writeln( "	<param name='ShowCaptioning' value='false' />");
	document.writeln( "	<param name='ShowAudioControls' value='true' /");
	document.writeln( "	<param name='ShowDisplay' value='false' />");
	document.writeln( "	<param name='ShowPositionControls' value='true' /> <!-- Forward,Rewind -->");
	document.writeln( "	<param name='ShowStatusBar' value='false' />");
	document.writeln( "	<param name='ShowTracker' value='true' />");
	
	document.writeln( "	<param name='Mute' value='false' />");
	document.writeln( AutoStart_param );
	document.writeln( ShowControls_param );
	document.writeln( "	<param name='FileName' value='" + strMovieUrl + "'>");

	document.writeln( "	<!-- Hixie method -->");
	document.writeln( "	<!--[if !IE]> <-->");
	document.writeln( "		<object id='objWMPlayer' name='objWMPlayer' type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' data='" + strMovieUrl + "' " + objSize_attribute + objId_attribute + AutoStart_attribute + ShowControls_attribute + ">");
	document.writeln( "	<!--> <![endif]-->");

	document.writeln( "</object>");

}
// BannerLoader
	function BannerLoader(strTarget, strLinkUrl){
		if (strTarget == 'blank'){
			winBannerLoc = window.open('about:blank', 'winBanner','');
			if (winBannerLoc != undefined){
				winBannerLoc.location.href = strLinkUrl; return;
			}
			location.reload(); return;
		}else{
			if (strLinkUrl != '#'){
				location.href = strLinkUrl; return;
			}
		}
	}
	
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function initMoving(target, topPosition, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 20)
}

function makeRequest(url) { 
	var http_request = false; 
		if (window.XMLHttpRequest) { // Mozilla, Safari, ... 
			http_request = new XMLHttpRequest(); 
		}else if (window.ActiveXObject) { // IE 
			try { 
				http_request = new ActiveXObject("Msxml2.XMLHTTP"); 
			} catch (e) { 
			try { 
				http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
			} catch (e) {} 
		} 
	} 
	if (!http_request) { 
		alert('Giving up :( Cannot create an XMLHTTP instance'); 
	return false; 
	} 
	http_request.onreadystatechange = function() { 
		if (http_request.readyState == 4) { 
			if (http_request.status == 200) { 
				alert(http_request.responseText);  
			} else { 
				alert('There was a problem with the request.'); 
			} 		
		} 
	}; 
		http_request.open('GET', url, true); 
		http_request.send(null); 
	} 
	////////////////////
	
		function setWindowResize(){
		//document.body.style.overflow='hidden';
		var clintAgent = navigator.userAgent;
		var w = document.body.scrollWidth;
		var h = document.body.scrollHeight;
		if ( clintAgent.indexOf("MSIE") != -1 ){
			window.resizeBy(w-document.body.clientWidth, h-document.body.clientHeight);		// IE
		}else{
			window.resizeBy(w-window.innerWidth, h-window.innerHeight);
		}
	}

function sndLoginForm(){
		var frm = document.frmMemLogin;
		var sndFlag = false;
		var objUid = document.getElementById("login");
		var objPw = document.getElementById("pw");
		if (objUid != 'undefined' && objPw != 'undefined'){
			if (sndFlag == false){
				sndFlag = true;
				frm.target = '_self';
				frm.action = '/login/';
				frm.submit()
			}else{
				alert('Please insert username and password');
				}
		}else{
			alert('Some fields were left blank, please try again.');
			return false;
		}
	}
