	function expandDiv(div){ 
		if (document.getElementById(div).style.display == 'none') { 
			document.getElementById(div).style.display = ''; 
		} else {
			document.getElementById(div).style.display = 'none'; 
		} 
	}

	function openWinPic(title, img_path, w, h) {

			window.open('http://blog.cyecorp.ro/open_pic.php?pic=' + img_path + '&title=' + title,'blog_pix','width=' + (w+50) + ',height=' + (h+80) + ',resizable=0,left=200,top=100'); 
			//document.write('<title>Open Picture: ' + title + '</title>');
			
	}//openWinPic

	function openWinGame(title, gameid, w, h) {

			rand_win = Math.floor(Math.random()*3948568345);

			window.open('http://blog.cyecorp.ro/open_game.php?gameid=' + gameid + '&title=' + title + '&w=' + w,'blog_games_' + rand_win,'width=' + (w+50) + ',height=' + (h+120) + ',resizable=0,left=400,top=200'); 
			//document.write('<title>Open Picture: ' + title + '</title>');
			
	}//openWinGame

	function turnOfftheLight() {
		document.getElementById('body').style.background="url(http://pix.cyecorp.ro/images/cyecorp_wp_28_2500x1500.jpg)";
		document.getElementById('light').innerHTML='<input type="button" value="Turn On the Light !" onclick="turnOntheLight();">';
		

	}//turnOfftheLight

	function turnOntheLight() {
		document.getElementById('body').style.background="url(http://pix.cyecorp.ro/img/cyecorp_wallpaper_25_CyECORP_ro.jpg)";
		document.getElementById('light').innerHTML='<input type="button" value="Turn Off the Light !" onclick="turnOfftheLight();">';
	}//turnOfftheLight
	


	function execute(id, e) {
		if(window.event) e=window.event;
		var keycode=(e.keyCode)?e.keyCode:e.which;
		if(keycode == 13) {
			//alert('enter');

			//alert (document.location);

			if (id == 'search') {		//search with enter
				if (parent.document.getElementById('search_term') != null) {					
					/*g_search = window.open('http://www.google.com/search?q=' + document.getElementById('search_term').value, 'google', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=' + screen.width + ', height=' + screen.height + ', left=0, top=0');					*/

					blog_search = window.open('http://cyecorp.ro/blog/index.php?s=' + document.getElementById('search_term').value, 'cyeblog', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=' + screen.width + ', height=' + screen.height + ', left=0, top=0');
				}
			}
		}
	}//execute

	function search(id, search_engine) {
		if (id == 'search') {		//search with click
				if (parent.document.getElementById('search_term') != null) {
					if (search_engine == 'cyeblog')	{
						blog_search = window.open('http://cyecorp.ro/blog/index.php?s=' + document.getElementById('search_term').value, 'cyeblog', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=' + screen.width + ', height=' + screen.height + ', left=0, top=0');
					}

					if (search_engine == 'google')	{
						g_search = window.open('http://www.google.com/search?q=' + document.getElementById('search_term').value, 'google', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=' + screen.width + ', height=' + screen.height + ', left=0, top=0');
					}

					if (search_engine == 'youtube')	{
						yt_search = window.open('http://www.youtube.com/results?search_query=' + document.getElementById('search_term').value, 'youtube', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=' + screen.width + ', height=' + screen.height + ', left=0, top=0');
					}

					if (search_engine == 'dailymotion')	{
						yt_search = window.open('http://www.dailymotion.com/relevance/search/' + document.getElementById('search_term').value, 'dailymotion', 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=' + screen.width + ', height=' + screen.height + ', left=0, top=0');
					}
					
				}
		}
	}//search

	function over18(){
		//this function is used on blog/skins/_html_header.inc.php
		//window.opener=self;

		if (document.getElementById("youtube") != null ) {
				document.getElementById("youtube").src='http://www.youtube.com/v/bhbU5qBayNA?fs=1&amp;hl=en_US&amp;rel=0';
		}


		var over18_cookie = readCookie('over18');
		
		if (over18_cookie == null) {
			var retVal = confirm("This blog contains explicit material which is not suited for children. \nAre you over 18 ? (hitting OK you agree that you are over 18, this expires in 7 days)");
				if( retVal == true ){
						//alert("User wants to continue!");
						//return true;
						//document.getElementById("youtube").src='http://www.youtube.com/v/bhbU5qBayNA?fs=1&amp;hl=en_US&amp;rel=0&amp;autoplay=1';
						createCookie ("over18", "yes", 7);
				}else{
						
						//this.close();
						 //window.close();
						window.location.href="http://cyecorp.ro";
						//return false;
				}
		} else { 
			//alert("Cookie is created ! It's value is: " +readCookie('over18'));
		}
	}//over18


	function createCookie(name,value,days) {
		//script from http://www.quirksmode.org/js/cookies.html
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}//createCookie

	function readCookie(name) {
		//script from http://www.quirksmode.org/js/cookies.html
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}//readCookie

	function eraseCookie(name) {
		//script from http://www.quirksmode.org/js/cookies.html
		createCookie(name,"",-1);
	}//eraseCookie
