﻿/*  
	Name: Template Design Workshop scripts
	Version: 1.0
	Author: Ahmad Azimi - Vahid Zehtabi
	Author Url: http://skin.pictofx.com
*/

//if (document.getElementById) window.onerror=new Function("return true");

function getID(ID){
	if(document.all) return document.all[ID]
	else return document.getElementById(ID)
}

function get_cookie(Name){
	var search = Name + "="
	var returnvalue = ""
	if (document.cookie.length > 0){
		offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1)
				end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}

function showData(target, content){
	getID(target).innerHTML = content;
}

function toggleShow (hide,show){
	if(hide) getID(hide).style.display = "none";
	if(show) getID(show).style.display = "block";
}

function addEvent(obj, evType, fn){
	if(obj.addEventListener){
		obj.addEventListener(evType, fn, false); 
		return true;
	} else if (obj.attachEvent){
		var r = obj.attachEvent('on'+evType, fn);
		return r;
	} else {
		return false;
	}
}

function loaded() {
	
}

//******************************************************************************

addEvent(window, "load", loaded);

//******************************************************************************

function download(url, intID, time) {
	showData("downloadTimer", time);
	if (Number(time) == 0) {
		getID('downloadIntro').style.visibility = 'hidden';
		getID('downloadRegards').style.visibility = 'visible';
		clearInterval(intID);
	}
	if (Number(time) == 3) {
		window.location.href = url;
	}
}

