﻿// JavaScript Document
function Click(){
	alert('\n您好，欢迎光临苏州念美装饰网站！\n\n苏州家装经济实惠之选，联系：13404226895');
	window.event.returnValue = false;
	}

document.oncontextmenu = Click;

function copy(){
	var text = clipboardData.getData("text");
	text = text + "\r\n本文字来源于 苏州念美装饰(http://www.nianmei.com)，转载时请以链接形式注明出处。\r\n 网页地址：" + location.href;
	clipboardData.setData("text",text);
	}

function get_url(strnum){
	var shref = document.location.href;
	var args = shref.split("?");
	var retval = ""
	if (args[0] == shref){
		return retval;
		}
	else{
		var str = args[1];
		args = str.split("&");
		retval = args [strnum];
		return retval;
		}
	}

function isMatch(str1,str2){
	var index = str1.indexOf(str2);
	if (index == -1) return false;
	return true;
	}

//if (isMatch(window.location.hostname,"www.nianmei.com") == false){
//	window.location.href = "http://www.nianmei.com" + window.location.pathname;
//	}

////////////////////////////////  限制输入框字符  ////////////////////////////////////////////////
function getstr(theinput,t1){
	if (theinput.value.length > t1){
		alert (t1 + " 个字符限制！");
		theinput.value = theinput.value.substring(0,t1);
		theinput.focus();
		}
	}

////////////////////////////////  检查数据  ///////////////////////////////////////////////////
function ckmsg(theForm){
	if (theForm.bk_name.value == ""){
		alert("请填写您的姓名!");
		theForm.bk_name.focus();
		return false; 
		}
	if (theForm.bk_tel.value == ""){
		alert("请填写您的电话号码或手机号码!");
		theForm.bk_tel.focus();
		return false; 
		}
	if (theForm.bkinfo.value == ""){
		alert("请简单说明一下您的需求!");
		theForm.bk_info.focus();
		return false; 
		}
	}
////////////////////////////////  图片宽度  ////////////////////////////////////////////////////
function showimg(t,w,h){
	var img = new Image();
	img.src = t.src;
	if (img.width > 0 && img.height > 0){
		var rate = (w/img.width < h/img.height)?w/img.width:h/img.height;
		if (rate <= 1){
			t.width = img.width * rate;
			t.height = img.height * rate;
			}else{
				t.width = img.width;
				t.height = img.height;
				}
		}
	}
	
////////////////////////////////  动画  ////////////////////////////////////////////////////	
function swfad(f,w,h){
	f1 =  f.substring(1,f.lastIndexOf("."));
	document.writeln("<script type=\"text\/javascript\">");
	document.writeln("AC_FL_RunContent( 'codebase','http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=9,0,28,0','width','" + w + "','height','" + h + "','src','" + f1 + "','quality','high','pluginspage','http:\/\/www.adobe.com\/shockwave\/download\/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent','movie','" + f1 + "' ); \/\/end AC code");
	document.writeln("<\/script><noscript><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=9,0,28,0\" width=\"670\" height=\"170\">");
	document.writeln("    <param name=\"movie\" value=\"" + f + "\" \/>");
	document.writeln("    <param name=\"quality\" value=\"high\" \/>");
	document.writeln("    <param name=\"wmode\" value=\"transparent\" \/>");
	document.writeln("    <embed src=\"" + f + "\" width=\"" + w + "\" height=\"" + h + "\" quality=\"high\" pluginspage=\"http:\/\/www.adobe.com\/shockwave\/download\/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application\/x-shockwave-flash\" wmode=\"transparent\"><\/embed>");
	document.writeln("  <\/object>");
	document.writeln("<\/noscript>");
}

var sRepeat=null;
function doScrollerIE(dir,src,amount){
	if (amount==null) {amount=10}
	if (dir=="up") {document.all[src].scrollTop-=amount}else{document.all[src].scrollTop+=amount}
	if (sRepeat==null) {sRepeat = setInterval("doScrollerIE('" + dir + "','" + src + "'," + amount + ")",100)}
	return false
	}

window.document.onmouseout = new Function("clearInterval(sRepeat);sRepeat=null");
window.document.ondragstart = new Function("return false");

document.writeln("<script src=\"\/css\/swf.js\" type=\"text\/javascript\"><\/script>");
