function styleSelect(num) { document.cookie="style=" + num;
var styleNum = document.getElementById("styleselect");
if (num == '1') { styleNum.setAttribute("href", "../../style(black).css") } else { styleNum.setAttribute("href", "../../style.css") } }
function StSlCl() { $(document).ready(function() { $(".style-name").slideUp("600"); }); }
function newspage(str) { var xmlhttp;
document.getElementById("page-news").innerHTML="<div class='news-loading' align='center'><img src='http://www.w3-iran.com/images/load.gif' align='center' /></div>";
if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest(); } else  {  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200)  {  document.getElementById("page-news").innerHTML=xmlhttp.responseText;   } }
xmlhttp.open("GET","../theme/page.php?page=news&p="+str,true);
xmlhttp.send(null); }
function newscatpage(str) { var xmlhttp;
document.getElementById("page-news").innerHTML="<div class='news-loading' align='center'><img src='http://www.w3-iran.com/images/load.gif' align='center' /></div>";
if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest(); } else  {  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200)  {  document.getElementById("page-news").innerHTML=xmlhttp.responseText;   } }
xmlhttp.open("GET","../theme/page.php?page=newscat&value="+str,true);
xmlhttp.send(null); }
function article(str) { var xmlhttp;
document.getElementById("article-home").innerHTML="<div class='articles-loading' align='center'><img src='http://www.w3-iran.com/images/load.gif' align='center' /></div>";
if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest(); } else  {  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200)  {  document.getElementById("article-home").innerHTML=xmlhttp.responseText;   } }
xmlhttp.open("GET","../theme/page.php?page=showarticle&value="+str,true);
xmlhttp.send(null); }
function articlespage(str) { var xmlhttp;
document.getElementById("page-news").innerHTML="<div class='news-loading' align='center'><img src='http://www.w3-iran.com/images/load.gif' align='center' /></div>";
if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest(); } else  {  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200)  {  document.getElementById("page-news").innerHTML=xmlhttp.responseText;   } }
xmlhttp.open("GET","../theme/page.php?page=articles&p="+str,true);
xmlhttp.send(null); }
function show() {
var iframe = "<iframe id='myframe'></iframe>";
document.getElementById("check").innerHTML=iframe;   
txt=document.getElementById("trytext").value; var x = document.getElementById("myframe").contentDocument;
x.write(txt);}
function index(str) { var xmlhttp;
$(document).ready(function() {
$(".midd-comment").hide();
$(".now").removeClass("now");
$("#contact").css("paddingLeft", "0");$("#contact").css("paddingRight", "25px");
$("#"+str).addClass("now");
if (!str) {$("#index").addClass("now");}
if (str == "contact") {$("#contact").css("paddingLeft", "13px");$("#contact").css("paddingRight", "13px");}
$("#mid-index2").html("<div class='index-loading' align='center' style='display:none;position:absolute;'><img src='http://www.w3-iran.com/images/load.gif' align='center' /></div>");
var PageHeight = $(document).height();
var midpageheight = PageHeight-503;
var pagewidth = $(document).width();
var midpagewidth = (pagewidth-897)/2;
$(".index-loading").css("marginTop" , -midpageheight-114);
$(".index-loading").css("marginLeft" , midpagewidth);
$(".index-loading").css("marginRight" , midpagewidth);
$(".index-loading").css("height" , midpageheight);
$(".index-loading").slideDown("100");
});
if (window.XMLHttpRequest)  {  xmlhttp=new XMLHttpRequest(); } else  {  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");  }
xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200)  { 
$(document).ready(function() {
$(".index-loading").hide();
});
document.getElementById("mid-index").innerHTML=xmlhttp.responseText;
} }
xmlhttp.open("GET","../ajax.php?ajax=on&cat="+str+"&"+str+"=cat&"+str+"2=index",true);
xmlhttp.send(null); 
if (typeof history.pushState !== "undefined") {
if(!str) {
     history.pushState(null, 'Online Web Tutorials', 'http://www.webzoom.ir/index.html');
} else {
     history.pushState(null, str+'Online Web Tutorials', 'http://www.webzoom.ir/'+str+'/index.html');
}
}
}
