
window.onload=function(){
	mvbg();
}
window.onresize = resizeFix;
function resizeFix() {
	window.location.reload();
	mvbg();
}
function mvbg(){
	var obj=document.getElementById('bd');
	obj.style.backgroundAttachment="fixed";
	var ws=wSize();
	if(ws>=1300){
		obj.style.background="url(http://www.hairstraightening.net/images/bg1.gif) 350px 0 repeat-y";
	}else if(ws>=1200 && ws<1300){
		obj.style.background="url(http://www.hairstraightening.net/images/bg1.gif) 270px 0 repeat-y";
	}else if(ws>=1000 && ws < 1200){
		obj.style.background="url(http://www.hairstraightening.net/images/bg1.gif) 142px 0 repeat-y";
	}else if(ws>=820 && ws < 1000){
		obj.style.background="url(http://www.hairstraightening.net/images/bg1.gif) 102px 0 repeat-y";
	}else if(ws>=770 && ws<820){
		obj.style.background="url(http://www.hairstraightening.net/images/bg1.gif) 30px 0 repeat-y";
	}else if(ws<770){
		obj.style.background="url(http://www.hairstraightening.net/images/bg1.gif) 26px 0 repeat-y";
	}
}
function wSize() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myWidth = window.innerWidth;
  } else if( document.documentElement && document.documentElement.clientWidth ) {
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && document.body.clientWidth ) {
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function loadScript(url, callback){
    var script = document.createElement("script")
    script.type = "text/javascript";
    if (script.readyState){  //IE
        script.onreadystatechange = function(){
            if (script.readyState == "loaded" ||
                    script.readyState == "complete"){
                script.onreadystatechange = null;
                callback();
            }
        };
    } else {  //Others
        script.onload = function(){
            callback();
        };
    }
    script.src = url;
    document.getElementsByTagName("head")[0].appendChild(script);
}

