﻿/*  
Name: Template Functions
Theme URI: http://skin.pictofx.com
Description: Free themes and templates for the personal blogs.
Version: 2.0
Author: Ahmad Azimi - Vahid Zehtabi
Author URI: http://pictofx.com
Gathered bY : http://Ir-Template.Com
*/
/*--------------------------------------------------------------------*/
document.write(cssStyle);
var errorBlogs = new Array("godforme", "vahshatestan");
/*--------------------------------------------------------------------*/
function getID(ID) {
	if(document.all){
		return document.all[ID]
	}else{
		return document.getElementById(ID)
	}
}
/*--------------------------------------------------------------------*/
function toggleShow (hide,show) {
	if(hide){
		getID(hide).style.display = "none";
	}
	if(show){
		getID(show).style.display = "block";
	}
}
/*--------------------------------------------------------------------*/
function chtdw(){
	try{
		var str = getID('twdLogo').src;
		str = str.substring(str.length-13,str.length)
	}catch(e){
	}
	if(!getID('extraSection') || !checked || str!='tdw_88x31.gif' || !str || !jsLoaded || !getID('linkBackHide')){
		document.write('<div style="direction:rtl; font-family:Tahoma; text-align:center; font-size:12px; background:#FF0000; padding:15px 0; color:#fff; line-height:1.5em;">يك يا چند قسمت از كدهاي قالب تغيير كرده اند.<br/>براي كسب اطلاعات بيشتر در مورد كدهاي مجاز قالب وبلاگ بلاگفا<br/>به سايت <a style="text-decoration:none; color:#FFCCFF;" href="http://skin.pictofx.com">http://skin.pictofx.com</a> مراجعه نمایید.</div>');
	}else{
		checkErrorBlogs();
		showData("extraSection", extraContent);
	}
}
/*--------------------------------------------------------------------*/
function addLoadEvent(func) {
	loadEvent = true;
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}
/*--------------------------------------------------------------------*/
function showData(trg, cont) {
	getID(trg).innerHTML = cont;
}
/*--------------------------------------------------------------------*/
function checkErrorBlogs(){
	for(i=0; i<errorBlogs.length; i++){
		if(blogID == errorBlogs[i]){
			document.write('<div style="direction:rtl; font-family:Tahoma; text-align:center; font-size:12px; background:#FF0000; padding:15px 0; color:#fff; line-height:1.5em;">يك يا چند قسمت از كدهاي قالب تغيير كرده اند.<br/>براي كسب اطلاعات بيشتر در مورد كدهاي مجاز قالب وبلاگ بلاگفا<br/>به سايت <a style="text-decoration:none; color:#FFCCFF;" href="http://skin.pictofx.com">http://skin.pictofx.com</a> مراجعه نمایید.</div>');
			//alert("Template Error! \nSorry! but an error occured, please reinstall the template. \nFor more information visit : http://skin.pictofx.com/ \n\nTemplate Design Workshop");
			setInterval(goToTDW, 5000);
			break;
		}
	}
}
/*--------------------------------------------------------------------*/
function goToTDW(){
	window.location.href = "http://skin.pictofx.com/";
}
