/*
*
* Mihalism multi host v3.1.x                      
* Copyright (c) 2005 - 2007 Mihalism Inc (www.mihalism.com)
*
*/

num = 0;
dah = 10
var saveWidth = 0;

function dispMoreFiles(type) {
	if (num<dah) {
		var filelocal = document.getElementById('morefiles');
		var fileID = "file"+num+"input";
		var fileDIV = document.createElement('div');
		fileDIV.setAttribute("id", fileID);
		if (type == 'url_upload') {
			fileDIV.innerHTML = "<INPUT name='userfile[]' id='"+fileID+"' TYPE='text' size='50'> <input type=\"button\" onclick=\"javascript:rmvMoreFiles('"+fileID+"')\" style=\"height:20px;\" value=\"Remove\"> <br>";
		} else {
			fileDIV.innerHTML = "<INPUT name='userfile[]' id='"+fileID+"' class='file_input' TYPE='file' size='50'> <input type=\"button\" onclick=\"javascript:rmvMoreFiles('"+fileID+"')\" style=\"height:21px;\" value=\"Remove\"> <br>";
		}
		filelocal.appendChild(fileDIV);
		num++;
	} else {
		alert('You can only add '+dah+' files to each upload.');
	}
}
	
function rmvMoreFiles(divNum){
	var d = document.getElementById('morefiles');
	var olddiv = document.getElementById(divNum);
	d.removeChild(olddiv);
	num--;
}

function highlight(field) {
       	field.focus();
       	field.select();
}

function toggle(id) {
	var obj = "";
	if(document.getElementById){
		obj = document.getElementById(id);
	}else if(document.all){
		obj = document.all[id];
	}else if(document.layers){
		obj = document.layers[id];
	}else{
		return 1;
	}
	if (!obj){
		return 1;
	}else if(obj.style){
		obj.style.display = ( obj.style.display != "none" ) ? "none" : "";
	}else{ 
		obj.visibility = "show"; 
	}
}


function scaleImg(what)
{
 what = document.getElementById(what);
 if (navigator.appName=="Netscape")
  winW = window.innerWidth;
 if (navigator.appName.indexOf("Microsoft")!=-1)
  winW = document.body.offsetWidth;
 if (what.width>(720) || saveWidth>(720)) 
 {
  if (what.width==(720))
  {
   what.width=saveWidth;
  }else
   {
    saveWidth = what.width;
    what.style.cursor = "pointer";
    what.width=(720);
   }
 }
}

if(dah != 10){
	alert("INVALID KEY");
}