function flash_zoom(d) {
	obj = document.getElementById("flash_game_object");
	embed = document.getElementById("flash_game_embed");
	if (d==0) {
		nw = obj.width*0.9;
		nh = obj.height*0.9;
		window.resizeBy(nw-(obj.width*0.98),nh-(obj.height*0.98));
	} else {
		nw = obj.width*1.1;
		nh = obj.height*1.1;
		window.moveBy(-(nw-obj.width),-(nh-obj.height)); 
		window.resizeBy(nw-obj.width,nh-obj.height);
	}
	
	obj.width = nw;
	obj.height = nh;
	embed.width = nw;
	embed.height = nh;
}
function voteToInner(){
	if(xml.readyState == 4){
		if(xml.status == 200){
			document.getElementById("rateDiv").innerHTML = xml.responseText;
		}
	}
}
function voteTo(game,vote){
	xmlRequest("post","http://www.vins.co.il/index.php?action=ajax","place=game&requested=vote&game="+game+"&vote="+vote,voteToInner);
}
var messageCounter = 0;
function copyCode(message) {
	var text2copy = document.getElementById("textCode").value;
	if(window.clipboardData){
		window.clipboardData.setData("Text",text2copy);
		alert(message);
	}else{
		var flashcopier = 'flashcopier';
    	if(!document.getElementById(flashcopier)){
			var divholder = document.createElement('div');
			divholder.id = flashcopier;
			document.body.appendChild(divholder);
		}
    	document.getElementById(flashcopier).innerHTML = '';
    	var divinfo = '<embed src="http://www.vins.co.il/style/_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    	document.getElementById(flashcopier).innerHTML = divinfo;
    	if(messageCounter == 0){
    		alert(message);
    		messageCounter = 1;
    	}else{
    		messageCounter = 0;
    	}
  	}
}
var times=0;
var originalWidth=0;
function changeSize(which){
	var flash = window.movie || document.movie; // Get Flash object.
	if(which == "larger"){
		if(times <= 0){
			times++;
			flash.width *= 1.5;
			if(findIE6 != -1)
			{
				if(flash.width > 825){
					originalWidth = flash.width;
					flash.width = 825;
				}
			}
			flash.height *= 1.5;
			//flash.Zoom(0);
		}
	}else{
		if(times >= -3){
			times--;
			if(findIE6 != -1){
				if(originalWidth > 825){
					flash.width = originalWidth / 1.5;
				}
			}else{
				flash.width /= 1.5;
			}
			flash.height /= 1.5;
			//flash.Zoom(0);
		}
	}
}
function changeGameInner(){
	if(xml.readyState == 4){
		if(xml.status == 200){
			if(xml.responseText != ""){
				var values = xml.responseText.split(";;;");
				document.title = values[0];
				document.getElementById("mainBigTitle").innerHTML = values[0];
				document.getElementById("gameSummery").innerHTML = values[1];
				document.getElementById("rateDiv").innerHTML = values[2];
				document.getElementById("gameCodes").innerHTML = values[3];
				document.getElementById("gameObjectDiv").innerHTML = values[4];
				times=0;
			}
		}
	}
}
function changeGame(game,where){
	xmlRequest("post","http://www.vins.co.il/index.php?action=ajax","place=game&requested=game&game="+game+"&where="+where,changeGameInner);
}
var lastCatagory = "sameGames";
var lastFullList=1;
var catagoriesValues = [];
var currentInCatagories = [];
function changeCatagory(catagory,number){
	if(catagory != lastCatagory){
		document.getElementById("catagory_"+lastCatagory).className = "clipsbuttonoff";
		document.getElementById("catagory_"+catagory).className = "clipsbuttonon";
		document.getElementById("div_"+lastCatagory).className = "hidden";
		document.getElementById("div_"+catagory).className = "shown";
		if(lastFullList != number){
			document.getElementById("fullList"+lastFullList).className = "hidden";
			document.getElementById("fullList"+number).className = "fulllink2";
			lastFullList = number;
		}
		lastCatagory = catagory;
	}
}
function makeMoveButtomInner(){
	if(xml.readyState == 4){
		if(xml.status == 200){
			catagoriesValues[lastCatagory][currentInCatagories[lastCatagory]] = xml.responseText;
			document.getElementById("div_"+lastCatagory).innerHTML = xml.responseText;
		}
	}
}
function makeMoveButtom(where,catagory,keywords,id){
	if(currentInCatagories[lastCatagory] === undefined || currentInCatagories[lastCatagory] === 0){
		currentInCatagories[lastCatagory] = 1;
		catagoriesValues[lastCatagory] = [];
		catagoriesValues[lastCatagory][0] = document.getElementById("div_"+lastCatagory).innerHTML;
	}
	if(where == "right"){
		currentInCatagories[lastCatagory]--;
		if(currentInCatagories[lastCatagory] === 0){
			currentInCatagories[lastCatagory] = 3;
		}
	}else{
		currentInCatagories[lastCatagory]++;
		if(currentInCatagories[lastCatagory] == 4){
			currentInCatagories[lastCatagory] = 1;
		}
	}
	if(catagoriesValues[lastCatagory][currentInCatagories[lastCatagory]] !== undefined && catagoriesValues[lastCatagory][currentInCatagories[lastCatagory]] !== 0){
		document.getElementById("div_"+lastCatagory).innerHTML = catagoriesValues[lastCatagory][currentInCatagories[lastCatagory]];
	}else{
		xmlRequest("post","http://www.vins.co.il/index.php?action=ajax","place=game&requested=buttom&id="+id+"&keywords="+keywords+"&catagory="+catagory+"&type="+lastCatagory+"&current="+currentInCatagories[lastCatagory],makeMoveButtomInner);
	}
}

function OpenScorePlug (){
	window.open ("http://www.scoreplug.com");
}